diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-29 08:09:38 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-29 08:09:38 (GMT) |
commit | 0ccd69cd51c7e067fbb26f6c47270c03f5c0568c (patch) | |
tree | 1e149375f847a1b305e099787d9f02d21473e437 /tests/auto | |
parent | e7c1be332bc89a8e56ec90eb865c9bd8ac14752b (diff) | |
download | Qt-0ccd69cd51c7e067fbb26f6c47270c03f5c0568c.zip Qt-0ccd69cd51c7e067fbb26f6c47270c03f5c0568c.tar.gz Qt-0ccd69cd51c7e067fbb26f6c47270c03f5c0568c.tar.bz2 |
Testcase for warnings at shutdown
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/shutdownErrors.qml | 13 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 17 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/shutdownErrors.qml b/tests/auto/declarative/qmlecmascript/data/shutdownErrors.qml new file mode 100644 index 0000000..398489a --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/shutdownErrors.qml @@ -0,0 +1,13 @@ +import Qt 4.6 + +Item { + property int test: myObject.object.a + + Item { + id: myObject + property Object object; + object: Object { + property int a: 10 + } + } +} diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 48c2249..98e9daf 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -67,6 +67,7 @@ private slots: void listProperties(); void exceptionClearsOnReeval(); void transientErrors(); + void shutdownErrors(); private: QmlEngine engine; @@ -870,6 +871,22 @@ void tst_qmlecmascript::transientErrors() QCOMPARE(transientErrorsMsgCount, 0); } +// Check that errors during shutdown are minimized +void tst_qmlecmascript::shutdownErrors() +{ + QmlComponent component(&engine, TEST_FILE("shutdownErrors.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + + transientErrorsMsgCount = 0; + QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler); + + delete object; + + qInstallMsgHandler(old); + QCOMPARE(transientErrorsMsgCount, 0); +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" |