diff options
author | Erik Verbruggen <erik.verbruggen@me.com> | 2013-01-15 13:30:55 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-16 11:31:53 +0100 |
commit | f3660c25e136966b3113f252f4900bca87f6ed3a (patch) | |
tree | 1994a77662ac450f750d71cfa670b5d1a477bcbc /tests | |
parent | ffccfdcbe4fe7f6a7c30462eeb5a7028e31373a0 (diff) |
Make numeric-literal parsing even more robust.
The numeric value could overflow a unsigned 64-bit integer, so instead
just buffer the string and have libc's strtod handle all the conversion.
Change-Id: I220e490ddc22363460b0df65a91b47336e747310
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/literals.qml | 1 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/literals.qml b/tests/auto/qml/qqmllanguage/data/literals.qml index 462eb4c26d..564b389760 100644 --- a/tests/auto/qml/qqmllanguage/data/literals.qml +++ b/tests/auto/qml/qqmllanguage/data/literals.qml @@ -9,6 +9,7 @@ QtObject { property variant n6: 3e+12 property variant n7: 0.1e9 property variant n8: 1152921504606846976 + property variant n9: 100000000000000000000 property variant c1: "\b" // special characters property variant c2: "\f" diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 850e1922a4..d7fa515f1d 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -3053,7 +3053,8 @@ void tst_qqmllanguage::literals_data() QTest::newRow("fp3") << "n5" << QVariant(3e-12); QTest::newRow("fp4") << "n6" << QVariant(3e+12); QTest::newRow("fp5") << "n7" << QVariant(0.1e9); - QTest::newRow("large-int") << "n8" << QVariant((double) 1152921504606846976); + QTest::newRow("large-int1") << "n8" << QVariant((double) 1152921504606846976); + QTest::newRow("large-int2") << "n9" << QVariant(100000000000000000000.); QTest::newRow("special1") << "c1" << QVariant(QString("\b")); QTest::newRow("special2") << "c2" << QVariant(QString("\f")); |