summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptstring
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-16 12:21:58 +0200
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-16 12:21:58 +0200
commit28704667a005ea37184624e89bc9e151f2d41deb (patch)
tree9f8f3e5e67edc0c56006544a3764dd6396e2bd9b /tests/auto/qscriptstring
parente55a5e173877a20586245eac2080ba9c6fa4de0a (diff)
New test cases for the QScriptString.
New behavioral checks for an invalid QScriptString and for not a number QScriptString. Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qscriptstring')
-rw-r--r--tests/auto/qscriptstring/tst_qscriptstring.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/qscriptstring/tst_qscriptstring.cpp b/tests/auto/qscriptstring/tst_qscriptstring.cpp
index f336dbe4d9..808b6439e9 100644
--- a/tests/auto/qscriptstring/tst_qscriptstring.cpp
+++ b/tests/auto/qscriptstring/tst_qscriptstring.cpp
@@ -87,6 +87,8 @@ void tst_QScriptString::test()
QScriptString str2 = str;
QVERIFY(!str2.isValid());
+
+ QCOMPARE(str.toArrayIndex(), quint32(0xffffffff));
}
for (int x = 0; x < 2; ++x) {
@@ -172,6 +174,7 @@ void tst_QScriptString::toArrayIndex_data()
QTest::newRow("0a") << QString::fromLatin1("0a") << false << quint32(0xffffffff);
QTest::newRow("0x1") << QString::fromLatin1("0x1") << false << quint32(0xffffffff);
QTest::newRow("01") << QString::fromLatin1("01") << false << quint32(0xffffffff);
+ QTest::newRow("101a") << QString::fromLatin1("101a") << false << quint32(0xffffffff);
QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe);
QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff);
}