diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-23 08:29:05 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-23 08:29:05 (GMT) |
commit | 49e086e5267a5bb512163bb3c6ba568002669e9d (patch) | |
tree | 8a894d3655f70f9ddfe5d48f728615f812032272 /tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | |
parent | 14b352dc58aa9790c8d1c2af0e546be975ef315c (diff) | |
download | Qt-49e086e5267a5bb512163bb3c6ba568002669e9d.zip Qt-49e086e5267a5bb512163bb3c6ba568002669e9d.tar.gz Qt-49e086e5267a5bb512163bb3c6ba568002669e9d.tar.bz2 |
Clear exceptions after a binding evaluation
Diffstat (limited to 'tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index a7a2ef6..a0e65c5 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -65,6 +65,7 @@ private slots: void scriptErrors(); void signalTriggeredBindings(); void listProperties(); + void exceptionClearsOnReeval(); private: QmlEngine engine; @@ -818,6 +819,27 @@ void tst_qmlecmascript::listProperties() QCOMPARE(object->property("test8").toBool(), true); } +void tst_qmlecmascript::exceptionClearsOnReeval() +{ + QmlComponent component(&engine, TEST_FILE("exceptionClearsOnReeval.qml")); + QString url = component.url().toString(); + + QString warning = url + ":4: TypeError: Result of expression 'objectProperty.objectProperty' [undefined] is not an object."; + + QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); + MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->property("test").toBool(), false); + + MyQmlObject object2; + MyQmlObject object3; + object2.setObjectProperty(&object3); + object->setObjectProperty(&object2); + + QCOMPARE(object->property("test").toBool(), true); +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" |