From 8c2ca33073f20e1fe552bd8b5f663aec5b8a634d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 15 Oct 2015 15:40:26 +0200 Subject: Replace qdtoa and qstrtod implementation by a 3rdparty library This also fixes the underlying cause of QTBUG-44039 and QTBUG-43885. You can choose between system, qt, and no libdouble-conversion support. If you choose "no", snprintf_l and sscanf_l will be used. By default, system double conversion is used if the system provides a double-conversion library. Otherwise the bundled libdouble-conversion is built. sscanf_l and snprintf_l are not used by default as the planned "shortest" conversion mode to produce the shortest possible string will give less precise results when implemented with snprintf_l. Change-Id: I8ca08a0fca5c54cf7009e48e771385614f6aa031 Reviewed-by: Simon Hausmann --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/corelib/tools/qstring/tst_qstring.cpp') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index ca6046884a..cb911853e8 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -4679,6 +4679,11 @@ void tst_QString::number() QCOMPARE( QString::number(4.4), QLatin1String("4.4") ); QCOMPARE( QString::number(Q_INT64_C(-555)), QLatin1String("-555") ); QCOMPARE( QString::number(Q_UINT64_C(6666)), QLatin1String("6666") ); + +#ifndef QT_NO_DOUBLECONVERSION // snprintf_l is too stupid for this + QCOMPARE( QString::number(12.05, 'f', 1), QString("12.1") ); + QCOMPARE( QString::number(12.5, 'f', 0), QString("13") ); +#endif } void tst_QString::capacity_data() -- cgit v1.2.3