Internal change

PiperOrigin-RevId: 448361090
Change-Id: Iec6063b88a778dfe815081612650eaa456503265
pull/1181/head
Abseil Team 3 years ago committed by Copybara-Service
parent 3af16ffea8
commit f7a250aa9a
  1. 26
      absl/random/beta_distribution_test.cc

@ -45,15 +45,25 @@ namespace {
template <typename IntType> template <typename IntType>
class BetaDistributionInterfaceTest : public ::testing::Test {}; class BetaDistributionInterfaceTest : public ::testing::Test {};
// double-double arithmetic is not supported well by either GCC or Clang; see constexpr bool ShouldExerciseLongDoubleTests() {
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99048, // long double arithmetic is not supported well by either GCC or Clang on
// most platforms specifically not when implemented in terms of double-double;
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99048,
// https://bugs.llvm.org/show_bug.cgi?id=49131, and // https://bugs.llvm.org/show_bug.cgi?id=49131, and
// https://bugs.llvm.org/show_bug.cgi?id=49132. Don't bother running these tests // https://bugs.llvm.org/show_bug.cgi?id=49132.
// with double doubles until compiler support is better. // So a conservative choice here is to disable long-double tests pretty much
using RealTypes = // everywhere except on x64 but only if long double is not implemented as
std::conditional<absl::numeric_internal::IsDoubleDouble(), // double-double.
::testing::Types<float, double>, #if defined(__i686__) && defined(__x86_64__)
::testing::Types<float, double, long double>>::type; return !absl::numeric_internal::IsDoubleDouble();
#else
return false;
#endif
}
using RealTypes = std::conditional<ShouldExerciseLongDoubleTests(),
::testing::Types<float, double, long double>,
::testing::Types<float, double>>::type;
TYPED_TEST_SUITE(BetaDistributionInterfaceTest, RealTypes); TYPED_TEST_SUITE(BetaDistributionInterfaceTest, RealTypes);
TYPED_TEST(BetaDistributionInterfaceTest, SerializeTest) { TYPED_TEST(BetaDistributionInterfaceTest, SerializeTest) {

Loading…
Cancel
Save