summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-16 10:21:58 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2010-02-16 10:21:58 (GMT)
commit28704667a005ea37184624e89bc9e151f2d41deb (patch)
tree9f8f3e5e67edc0c56006544a3764dd6396e2bd9b /tests
parente55a5e173877a20586245eac2080ba9c6fa4de0a (diff)
downloadQt-28704667a005ea37184624e89bc9e151f2d41deb.zip
Qt-28704667a005ea37184624e89bc9e151f2d41deb.tar.gz
Qt-28704667a005ea37184624e89bc9e151f2d41deb.tar.bz2
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')
-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 f336dbe..808b643 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);
}