85 QScriptString str1(str); |
85 QScriptString str1(str); |
86 QVERIFY(!str1.isValid()); |
86 QVERIFY(!str1.isValid()); |
87 |
87 |
88 QScriptString str2 = str; |
88 QScriptString str2 = str; |
89 QVERIFY(!str2.isValid()); |
89 QVERIFY(!str2.isValid()); |
|
90 |
|
91 QCOMPARE(str.toArrayIndex(), quint32(0xffffffff)); |
90 } |
92 } |
91 |
93 |
92 for (int x = 0; x < 2; ++x) { |
94 for (int x = 0; x < 2; ++x) { |
93 QString ciao = QString::fromLatin1("ciao"); |
95 QString ciao = QString::fromLatin1("ciao"); |
94 QScriptString str = eng.toStringHandle(ciao); |
96 QScriptString str = eng.toStringHandle(ciao); |
170 QTest::newRow("123") << QString::fromLatin1("123") << true << quint32(123); |
172 QTest::newRow("123") << QString::fromLatin1("123") << true << quint32(123); |
171 QTest::newRow("-1") << QString::fromLatin1("-1") << false << quint32(0xffffffff); |
173 QTest::newRow("-1") << QString::fromLatin1("-1") << false << quint32(0xffffffff); |
172 QTest::newRow("0a") << QString::fromLatin1("0a") << false << quint32(0xffffffff); |
174 QTest::newRow("0a") << QString::fromLatin1("0a") << false << quint32(0xffffffff); |
173 QTest::newRow("0x1") << QString::fromLatin1("0x1") << false << quint32(0xffffffff); |
175 QTest::newRow("0x1") << QString::fromLatin1("0x1") << false << quint32(0xffffffff); |
174 QTest::newRow("01") << QString::fromLatin1("01") << false << quint32(0xffffffff); |
176 QTest::newRow("01") << QString::fromLatin1("01") << false << quint32(0xffffffff); |
|
177 QTest::newRow("101a") << QString::fromLatin1("101a") << false << quint32(0xffffffff); |
175 QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe); |
178 QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe); |
176 QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff); |
179 QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff); |
|
180 QTest::newRow("0.0") << QString::fromLatin1("0.0") << false << quint32(0xffffffff); |
|
181 QTest::newRow("1.0") << QString::fromLatin1("1.0") << false << quint32(0xffffffff); |
|
182 QTest::newRow("1.5") << QString::fromLatin1("1.5") << false << quint32(0xffffffff); |
|
183 QTest::newRow("1.") << QString::fromLatin1("1.") << false << quint32(0xffffffff); |
|
184 QTest::newRow(".1") << QString::fromLatin1(".1") << false << quint32(0xffffffff); |
|
185 QTest::newRow("1e0") << QString::fromLatin1("1e0") << false << quint32(0xffffffff); |
177 } |
186 } |
178 |
187 |
179 void tst_QScriptString::toArrayIndex() |
188 void tst_QScriptString::toArrayIndex() |
180 { |
189 { |
181 QFETCH(QString, input); |
190 QFETCH(QString, input); |