diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-01-15 16:54:20 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-01-30 17:57:40 +0100 |
commit | 264ed73052513015caafaf146286cf63aaa68b03 (patch) | |
tree | d24647e7d078388a9d57727a31f68eb3227c1206 /tests/auto/corelib/text/qstring | |
parent | 47d94dab0fbc428e5c3401c411ac01a05e5e851f (diff) |
Move old tst_QLocale::negativeZero() to tst_QString::number()
It was more complex than it needed to be and was a test of QString,
not of QLocale. This leaves tst_QLocale::negativeZero() available to
now test how QLocale handles negative zero.
Change-Id: Ic9aae250c29f579e6d60fba8404b38673a3b489f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qstring')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index e5b5e526de..ca58b664a0 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -4927,13 +4927,14 @@ void tst_QString::arg() void tst_QString::number() { - QCOMPARE( QString::number(int(0)), QLatin1String("0") ); - QCOMPARE( QString::number((unsigned int)(11)), QLatin1String("11") ); - QCOMPARE( QString::number(-22L), QLatin1String("-22") ); - QCOMPARE( QString::number(333UL), QLatin1String("333") ); - 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") ); + QCOMPARE(QString::number(int(0)), QLatin1String("0")); + QCOMPARE(QString::number(std::copysign(0.0, -1.0)), QLatin1String("0")); + QCOMPARE(QString::number((unsigned int)(11)), QLatin1String("11")); + QCOMPARE(QString::number(-22L), QLatin1String("-22")); + QCOMPARE(QString::number(333UL), QLatin1String("333")); + 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") ); |