diff options
author | Abseil Team <absl-team@google.com> | 2020-12-21 04:44:34 -0800 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2020-12-21 12:28:32 -0500 |
commit | 8a9ef3c5da2a9064dda0ac3c61b43b87c12c50b8 (patch) | |
tree | e6b59a8540fd6f8fa8ee86de67837696bfdccd27 /absl/random | |
parent | 9f8b87b71b12c1df95ffededd4560cbf5dcb95b9 (diff) |
Export of internal Abseil changes
--
b95862447354428f62ae1627cf526e42ca0b7a9d by Christian Blichmann <cblichmann@google.com>:
Minor cleanups:
* Sorting using declarations
* Changing the format of a NOLINT statement
PiperOrigin-RevId: 348448885
--
954a4375fb09267e55dfda345605b9aca54998b0 by Abseil Team <absl-team@google.com>:
Enable some more Emscripten tests.
Requires setting -s PRINTF_LONG_DOUBLE=1 in a recent build.
PiperOrigin-RevId: 348043610
GitOrigin-RevId: b95862447354428f62ae1627cf526e42ca0b7a9d
Change-Id: I517c94a5fd0feb9b99823dc8552d28fa598723fe
Diffstat (limited to 'absl/random')
-rw-r--r-- | absl/random/exponential_distribution_test.cc | 4 | ||||
-rw-r--r-- | absl/random/gaussian_distribution_test.cc | 5 | ||||
-rw-r--r-- | absl/random/internal/iostream_state_saver_test.cc | 5 | ||||
-rw-r--r-- | absl/random/uniform_real_distribution_test.cc | 4 |
4 files changed, 4 insertions, 14 deletions
diff --git a/absl/random/exponential_distribution_test.cc b/absl/random/exponential_distribution_test.cc index 8e9e69b6..5a8afde5 100644 --- a/absl/random/exponential_distribution_test.cc +++ b/absl/random/exponential_distribution_test.cc @@ -47,11 +47,7 @@ using absl::random_internal::kChiSquared; template <typename RealType> class ExponentialDistributionTypedTest : public ::testing::Test {}; -#if defined(__EMSCRIPTEN__) -using RealTypes = ::testing::Types<float, double>; -#else using RealTypes = ::testing::Types<float, double, long double>; -#endif // defined(__EMSCRIPTEN__) TYPED_TEST_CASE(ExponentialDistributionTypedTest, RealTypes); TYPED_TEST(ExponentialDistributionTypedTest, SerializeTest) { diff --git a/absl/random/gaussian_distribution_test.cc b/absl/random/gaussian_distribution_test.cc index 02ac578a..2aa7caf4 100644 --- a/absl/random/gaussian_distribution_test.cc +++ b/absl/random/gaussian_distribution_test.cc @@ -130,15 +130,12 @@ TYPED_TEST(GaussianDistributionInterfaceTest, SerializeTest) { ss >> after; #if defined(__powerpc64__) || defined(__PPC64__) || defined(__powerpc__) || \ - defined(__ppc__) || defined(__PPC__) || defined(__EMSCRIPTEN__) + defined(__ppc__) || defined(__PPC__) if (std::is_same<TypeParam, long double>::value) { // Roundtripping floating point values requires sufficient precision // to reconstruct the exact value. It turns out that long double // has some errors doing this on ppc, particularly for values // near {1.0 +/- epsilon}. - // - // Emscripten is even worse, implementing long double as a 128-bit - // type, but shipping with a strtold() that doesn't support that. if (mean <= std::numeric_limits<double>::max() && mean >= std::numeric_limits<double>::lowest()) { EXPECT_EQ(static_cast<double>(before.mean()), diff --git a/absl/random/internal/iostream_state_saver_test.cc b/absl/random/internal/iostream_state_saver_test.cc index 7bb8ad95..6e66266c 100644 --- a/absl/random/internal/iostream_state_saver_test.cc +++ b/absl/random/internal/iostream_state_saver_test.cc @@ -14,6 +14,9 @@ #include "absl/random/internal/iostream_state_saver.h" +#include <errno.h> +#include <stdio.h> + #include <sstream> #include <string> @@ -272,7 +275,6 @@ TEST(IOStreamStateSaver, RoundTripDoubles) { } } -#if !defined(__EMSCRIPTEN__) TEST(IOStreamStateSaver, RoundTripLongDoubles) { // Technically, C++ only guarantees that long double is at least as large as a // double. Practically it varies from 64-bits to 128-bits. @@ -350,7 +352,6 @@ TEST(IOStreamStateSaver, RoundTripLongDoubles) { } } } -#endif // !defined(__EMSCRIPTEN__) TEST(StrToDTest, DoubleMin) { const char kV[] = "2.22507385850720138e-308"; diff --git a/absl/random/uniform_real_distribution_test.cc b/absl/random/uniform_real_distribution_test.cc index be107cdd..8cf874d6 100644 --- a/absl/random/uniform_real_distribution_test.cc +++ b/absl/random/uniform_real_distribution_test.cc @@ -55,11 +55,7 @@ namespace { template <typename RealType> class UniformRealDistributionTest : public ::testing::Test {}; -#if defined(__EMSCRIPTEN__) -using RealTypes = ::testing::Types<float, double>; -#else using RealTypes = ::testing::Types<float, double, long double>; -#endif // defined(__EMSCRIPTEN__) TYPED_TEST_SUITE(UniformRealDistributionTest, RealTypes); |