From dddfdb8e4a2adf1c0b529a88b53a4d37389ba66f Mon Sep 17 00:00:00 2001 From: Geert Bosch Date: Thu, 28 Apr 2016 10:42:14 -0400 Subject: SERVER-23966 Fix negation of lowest signed int --- src/mongo/platform/decimal128_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mongo/platform') diff --git a/src/mongo/platform/decimal128_test.cpp b/src/mongo/platform/decimal128_test.cpp index 296d6490514..7846ef58bf0 100644 --- a/src/mongo/platform/decimal128_test.cpp +++ b/src/mongo/platform/decimal128_test.cpp @@ -865,7 +865,7 @@ TEST(Decimal128Test, TestDecimal128ToIntExactSignaling) { Decimal128 d("10000000000000000"); uint32_t sigFlags = Decimal128::SignalingFlag::kNoFlag; int32_t intVal = d.toIntExact(&sigFlags); - ASSERT_EQUALS(intVal, -std::numeric_limits::lowest()); + ASSERT_EQUALS(intVal, std::numeric_limits::lowest()); // TODO: The supported library does not set the kInexact flag even though // the documentation claims to for exact integer conversions. // ASSERT_TRUE(Decimal128::hasFlag(sigFlags, Decimal128::SignalingFlag::kInexact)); @@ -876,7 +876,7 @@ TEST(Decimal128Test, TestDecimal128ToLongExactSignaling) { Decimal128 d("100000000000000000000000000"); uint32_t sigFlags = Decimal128::SignalingFlag::kNoFlag; int64_t longVal = d.toLongExact(&sigFlags); - ASSERT_EQUALS(longVal, -std::numeric_limits::lowest()); + ASSERT_EQUALS(longVal, std::numeric_limits::lowest()); // TODO: The supported library does not set the kInexact flag even though // the documentation claims to for exact integer conversions. // ASSERT_TRUE(Decimal128::hasFlag(sigFlags, Decimal128::SignalingFlag::kInexact)); -- cgit v1.2.1