summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/json')
-rw-r--r--tests/auto/corelib/json/json.pro4
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp16
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/auto/corelib/json/json.pro b/tests/auto/corelib/json/json.pro
index a8224fd201..b3038d7ca1 100644
--- a/tests/auto/corelib/json/json.pro
+++ b/tests/auto/corelib/json/json.pro
@@ -6,4 +6,8 @@ CONFIG += testcase
!android:TESTDATA += bom.json test.json test.bjson test3.json test2.json
else:RESOURCES += json.qrc
+!contains(QT_CONFIG, doubleconversion):!contains(QT_CONFIG, system-doubleconversion) {
+ DEFINES += QT_NO_DOUBLECONVERSION
+}
+
SOURCES += tst_qtjson.cpp
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"