Run all the new tests in full-precision mode only
until I know what the normal-precision algorithm really does...
This commit is contained in:
parent
319944a11a
commit
7101911d9b
@ -392,15 +392,6 @@ static void TestParseDouble() {
|
|||||||
"83723677529752585477247372368372368547354737253685475529752",
|
"83723677529752585477247372368372368547354737253685475529752",
|
||||||
6223372036854775808.0);
|
6223372036854775808.0);
|
||||||
|
|
||||||
|
|
||||||
TEST_DOUBLE(fullPrecision, "1e-325", 0.0);
|
|
||||||
TEST_DOUBLE(fullPrecision, "1e-324", 0.0);
|
|
||||||
TEST_DOUBLE(fullPrecision, "2e-324", 0.0);
|
|
||||||
TEST_DOUBLE(fullPrecision, "2.4703282292062327e-324", 0.0);
|
|
||||||
TEST_DOUBLE(fullPrecision, "2.4703282292062328e-324", 5e-324);
|
|
||||||
TEST_DOUBLE(fullPrecision, "2.48e-324",5e-324);
|
|
||||||
TEST_DOUBLE(fullPrecision, "2.5e-324", 5e-324);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Test (length + exponent) overflow
|
// Test (length + exponent) overflow
|
||||||
TEST_DOUBLE(fullPrecision, "0e+2147483647", 0.0);
|
TEST_DOUBLE(fullPrecision, "0e+2147483647", 0.0);
|
||||||
@ -412,6 +403,14 @@ static void TestParseDouble() {
|
|||||||
|
|
||||||
if (fullPrecision)
|
if (fullPrecision)
|
||||||
{
|
{
|
||||||
|
TEST_DOUBLE(fullPrecision, "1e-325", 0.0);
|
||||||
|
TEST_DOUBLE(fullPrecision, "1e-324", 0.0);
|
||||||
|
TEST_DOUBLE(fullPrecision, "2e-324", 0.0);
|
||||||
|
TEST_DOUBLE(fullPrecision, "2.4703282292062327e-324", 0.0);
|
||||||
|
TEST_DOUBLE(fullPrecision, "2.4703282292062328e-324", 5e-324);
|
||||||
|
TEST_DOUBLE(fullPrecision, "2.48e-324",5e-324);
|
||||||
|
TEST_DOUBLE(fullPrecision, "2.5e-324", 5e-324);
|
||||||
|
|
||||||
// Slightly above max-normal
|
// Slightly above max-normal
|
||||||
TEST_DOUBLE(fullPrecision, "1.7976931348623158e+308", 1.7976931348623158e+308);
|
TEST_DOUBLE(fullPrecision, "1.7976931348623158e+308", 1.7976931348623158e+308);
|
||||||
|
|
||||||
@ -431,8 +430,6 @@ static void TestParseDouble() {
|
|||||||
"828481044358810649108367633313557305310641892225870327827273"
|
"828481044358810649108367633313557305310641892225870327827273"
|
||||||
"41408256.000000",
|
"41408256.000000",
|
||||||
2.4354608055603473e+307);
|
2.4354608055603473e+307);
|
||||||
}
|
|
||||||
|
|
||||||
// 9007199254740991 * 2^971 (max normal)
|
// 9007199254740991 * 2^971 (max normal)
|
||||||
TEST_DOUBLE(fullPrecision,
|
TEST_DOUBLE(fullPrecision,
|
||||||
"1.797693134862315708145274237317043567980705675258449965989174768031572607800285"
|
"1.797693134862315708145274237317043567980705675258449965989174768031572607800285"
|
||||||
@ -559,10 +556,6 @@ static void TestParseDouble() {
|
|||||||
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e-308",
|
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e-308",
|
||||||
4.450147717014401778e-308 // 0x1.ffffffffffffep-1022
|
4.450147717014401778e-308 // 0x1.ffffffffffffep-1022
|
||||||
);
|
);
|
||||||
#if 0
|
|
||||||
// XXX:
|
|
||||||
// https://travis-ci.org/Tencent/rapidjson/jobs/393054531#L1634
|
|
||||||
|
|
||||||
// Slightly below half way between max-normal and infinity.
|
// Slightly below half way between max-normal and infinity.
|
||||||
// Should round down.
|
// Should round down.
|
||||||
TEST_DOUBLE(fullPrecision,
|
TEST_DOUBLE(fullPrecision,
|
||||||
@ -584,7 +577,7 @@ static void TestParseDouble() {
|
|||||||
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e+308",
|
"99999999999999999999999999999999999999999999999999999999999999999999999999999999e+308",
|
||||||
1.797693134862315708e+308 // 0x1.fffffffffffffp1023
|
1.797693134862315708e+308 // 0x1.fffffffffffffp1023
|
||||||
);
|
);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#undef TEST_DOUBLE
|
#undef TEST_DOUBLE
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user