diff options
Diffstat (limited to 'absl/numeric/int128_test.cc')
-rw-r--r-- | absl/numeric/int128_test.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/absl/numeric/int128_test.cc b/absl/numeric/int128_test.cc index 01e3eb5c..3f16e054 100644 --- a/absl/numeric/int128_test.cc +++ b/absl/numeric/int128_test.cc @@ -25,12 +25,7 @@ #include "absl/base/internal/cycleclock.h" #include "absl/hash/hash_testing.h" #include "absl/meta/type_traits.h" - -#if defined(_MSC_VER) && _MSC_VER == 1900 -// Disable "unary minus operator applied to unsigned type" warnings in Microsoft -// Visual C++ 14 (2015). -#pragma warning(disable:4146) -#endif +#include "absl/types/compare.h" #define MAKE_INT128(HI, LO) absl::MakeInt128(static_cast<int64_t>(HI), LO) @@ -237,8 +232,6 @@ TEST(Uint128, AllTests) { EXPECT_EQ(two, -((-one) - 1)); EXPECT_EQ(absl::Uint128Max(), -one); EXPECT_EQ(zero, -zero); - - EXPECT_EQ(absl::Uint128Max(), absl::kuint128max); } TEST(Int128, RightShiftOfNegativeNumbers) { @@ -792,6 +785,13 @@ TEST(Int128, ComparisonTest) { EXPECT_FALSE(pair.smaller >= pair.larger); // NOLINT(readability/check) EXPECT_TRUE(pair.smaller >= pair.smaller); // NOLINT(readability/check) EXPECT_TRUE(pair.larger >= pair.larger); // NOLINT(readability/check) + +#ifdef __cpp_impl_three_way_comparison + EXPECT_EQ(pair.smaller <=> pair.larger, absl::strong_ordering::less); + EXPECT_EQ(pair.larger <=> pair.smaller, absl::strong_ordering::greater); + EXPECT_EQ(pair.smaller <=> pair.smaller, absl::strong_ordering::equal); + EXPECT_EQ(pair.larger <=> pair.larger, absl::strong_ordering::equal); +#endif } } |