Skip to content

Commit 4050143

Browse files
committed
fix ValueTest/integers, CharReaderAllowSpecialFloatsTest/issue209 test failure when fp:fast on msvc
1 parent 3f0d91f commit 4050143

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test_lib_json/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,8 @@ JSONTEST_FIXTURE(ValueTest, integers) {
972972
JSONTEST_ASSERT_EQUAL(Json::UInt64(1) << 63, val.asUInt64());
973973
JSONTEST_ASSERT_EQUAL(Json::UInt64(1) << 63, val.asLargestUInt());
974974
JSONTEST_ASSERT_EQUAL(uint64ToDouble(Json::UInt64(1) << 63), val.asDouble());
975-
JSONTEST_ASSERT_EQUAL(float(uint64ToDouble(Json::UInt64(1) << 63)),
976-
val.asFloat());
975+
JSONTEST_ASSERT_EQUAL(float(Json::UInt64(1) << 63), val.asFloat());
976+
977977
JSONTEST_ASSERT_EQUAL(true, val.asBool());
978978
JSONTEST_ASSERT_STRING_EQUAL("9.2233720368547758e+18",
979979
normalizeFloatingPointStr(JsonTest::ToJsonString(val.asString())));
@@ -2405,7 +2405,7 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) {
24052405
JSONTEST_ASSERT_STRING_EQUAL("", errs);
24062406
JSONTEST_ASSERT_EQUAL(3u, root.size());
24072407
double n = root["a"].asDouble();
2408-
JSONTEST_ASSERT(n != n);
2408+
JSONTEST_ASSERT(isnan(n));
24092409
JSONTEST_ASSERT_EQUAL(std::numeric_limits<double>::infinity(), root.get("b", 0.0));
24102410
JSONTEST_ASSERT_EQUAL(-std::numeric_limits<double>::infinity(), root.get("c", 0.0));
24112411
}

0 commit comments

Comments
 (0)