summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmlecmascript/data/shutdownErrors.qml13
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp17
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"