diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 593b98dd60..11da627bd0 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1250,6 +1250,10 @@ void tst_QLocale::strtod_data() QTest::newRow("1e2000") << QString("1e2000") << qInf() << 6 << false; QTest::newRow("-1e2000") << QString("-1e2000") << -qInf() << 7 << false; + // Underflow - fails but reports right length: + QTest::newRow("1e-2000") << QString("1e-2000") << 0.0 << 7 << false; + QTest::newRow("-1e-2000") << QString("-1e-2000") << 0.0 << 8 << false; + // starts with junk, fails QTest::newRow("a0") << QString("a0") << 0.0 << 0 << false; QTest::newRow("a0.") << QString("a0.") << 0.0 << 0 << false; @@ -1285,6 +1289,10 @@ void tst_QLocale::strtod_data() QTest::newRow("1e2000 cruft") << QString("1e2000 cruft") << qInf() << 6 << false; QTest::newRow("-1e2000 cruft") << QString("-1e2000 cruft") << -qInf() << 7 << false; + // Underflow, ends with cruft - fails but reports right length: + QTest::newRow("1e-2000 cruft") << QString("1e-2000 cruft") << 0.0 << 7 << false; + QTest::newRow("-1e-2000 cruft") << QString("-1e-2000 cruft") << 0.0 << 8 << false; + // "0x" prefix, success but only for the "0" before "x" QTest::newRow("0x0") << QString("0x0") << 0.0 << 1 << true; QTest::newRow("0x0.") << QString("0x0.") << 0.0 << 1 << true; |