diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-10 15:41:01 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-23 14:13:48 +0000 |
commit | 573f87d81363a303b7005f999a283db624201db8 (patch) | |
tree | 0493995a00bba6df52f5322550d3005f597deb7e /tests/auto/corelib/json/tst_qtjson.cpp | |
parent | 15b5b3b3f01e400e46fe67babe593ede373dac4b (diff) |
Use "shortest" double conversion for JSON
Task-number: QTBUG-42419
Change-Id: I649c4de96a2e41078e139c0f382e5a6cf96d3bb9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/json/tst_qtjson.cpp')
-rw-r--r-- | tests/auto/corelib/json/tst_qtjson.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index e8d836683e..aebf332fe3 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -1408,9 +1408,7 @@ void tst_QtJson::toJsonLargeNumericValues() " \"Array\": [\n" " 1.234567,\n" " 1.7976931348623157e+308,\n" - // ((4.9406564584124654e-324 == 5e-324) == true) - // I can only think JavaScript has a special formatter to - // emit this value for this IEEE754 bit pattern. +#ifdef QT_NO_DOUBLECONVERSION // "shortest" double conversion is not very short then " 4.9406564584124654e-324,\n" " 2.2250738585072014e-308,\n" " 1.7976931348623157e+308,\n" @@ -1421,6 +1419,18 @@ void tst_QtJson::toJsonLargeNumericValues() " -1.7976931348623157e+308,\n" " -2.2204460492503131e-16,\n" " -4.9406564584124654e-324,\n" +#else + " 5e-324,\n" + " 2.2250738585072014e-308,\n" + " 1.7976931348623157e+308,\n" + " 2.220446049250313e-16,\n" + " 5e-324,\n" + " 0,\n" + " -2.2250738585072014e-308,\n" + " -1.7976931348623157e+308,\n" + " -2.220446049250313e-16,\n" + " -5e-324,\n" +#endif " 0,\n" " 9007199254740992,\n" " -9007199254740992\n" |