diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-10-29 13:15:45 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-10-29 14:06:20 (GMT) |
commit | bd3c35cf1cbdbde16df9357a08b8b45a96fa3a5e (patch) | |
tree | a9173bfdcad12dd1d8dee1a9c7f4940ee1a1f74c /tests/auto/qscriptvalueiterator | |
parent | bf8a9dc1248083dfb0ce5599b11af1727d349631 (diff) | |
download | Qt-bd3c35cf1cbdbde16df9357a08b8b45a96fa3a5e.zip Qt-bd3c35cf1cbdbde16df9357a08b8b45a96fa3a5e.tar.gz Qt-bd3c35cf1cbdbde16df9357a08b8b45a96fa3a5e.tar.bz2 |
Improve QtScript test coverage
Based on BullsEye coverage reports.
Diffstat (limited to 'tests/auto/qscriptvalueiterator')
-rw-r--r-- | tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp index 55773f0..df11537 100644 --- a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp +++ b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp @@ -71,6 +71,7 @@ private slots: void iterateString(); void iterateGetterSetter(); void assignObjectToIterator(); + void iterateNonObject(); }; tst_QScriptValueIterator::tst_QScriptValueIterator() @@ -583,5 +584,25 @@ void tst_QScriptValueIterator::assignObjectToIterator() QCOMPARE(it.name(), QString::fromLatin1("bar")); } +void tst_QScriptValueIterator::iterateNonObject() +{ + QScriptValueIterator it(123); + QVERIFY(!it.hasNext()); + it.next(); + QVERIFY(!it.hasPrevious()); + it.previous(); + it.toFront(); + it.toBack(); + it.name(); + it.scriptName(); + it.flags(); + it.value(); + it.setValue(1); + it.remove(); + QScriptValue num(5); + it = num; + QVERIFY(!it.hasNext()); +} + QTEST_MAIN(tst_QScriptValueIterator) #include "tst_qscriptvalueiterator.moc" |