diff options
4 files changed, 32 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/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h index ae3a954..8b5b10c 100644 --- a/tests/auto/declarative/qmlecmascript/testtypes.h +++ b/tests/auto/declarative/qmlecmascript/testtypes.h @@ -95,6 +95,7 @@ private: QList<QObject *> m_objectQList; }; +QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(MyQmlObject); class MyQmlContainer : public QObject 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" diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h index 355ff8b..c16d2f5 100644 --- a/tests/auto/declarative/qmllanguage/testtypes.h +++ b/tests/auto/declarative/qmllanguage/testtypes.h @@ -111,6 +111,7 @@ private: MyQmlObject *m_qmlobject; MyCustomVariantType m_custom; }; +QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(MyQmlObject); class MyGroupedObject : public QObject |