diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-14 07:27:45 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-14 08:49:19 (GMT) |
commit | 62b264e90a48997e1736d7a335bad99e2c52a50d (patch) | |
tree | 683cd6711510c414566384fba7e1777e703d5390 /tests/auto/declarative/qdeclarativeecmascript | |
parent | 6ae0b924102384d088c9a7f9b43170cf0d2668bd (diff) | |
download | Qt-62b264e90a48997e1736d7a335bad99e2c52a50d.zip Qt-62b264e90a48997e1736d7a335bad99e2c52a50d.tar.gz Qt-62b264e90a48997e1736d7a335bad99e2c52a50d.tar.bz2 |
Reduce warnings at shutdown
QTBUG-9799
Reviewed-by: Alexis Menard
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml new file mode 100644 index 0000000..86c312c --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Item { + property int children: root.children.length +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml new file mode 100644 index 0000000..a762d6d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +Item { + id: root + + Item {} + + SpuriousWarning {} +} + diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 12a065e..35b4d99 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -2242,6 +2242,7 @@ void tst_qdeclarativeecmascript::qtbug_9792() // Test that we shut down without stupid warnings void tst_qdeclarativeecmascript::noSpuriousWarningsAtShutdown() { + { QDeclarativeComponent component(&engine, TEST_FILE("noSpuriousWarningsAtShutdown.qml")); QObject *o = component.create(); @@ -2254,6 +2255,23 @@ void tst_qdeclarativeecmascript::noSpuriousWarningsAtShutdown() qInstallMsgHandler(old); QCOMPARE(transientErrorsMsgCount, 0); + } + + + { + QDeclarativeComponent component(&engine, TEST_FILE("noSpuriousWarningsAtShutdown.2.qml")); + + QObject *o = component.create(); + + transientErrorsMsgCount = 0; + QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler); + + delete o; + + qInstallMsgHandler(old); + + QCOMPARE(transientErrorsMsgCount, 0); + } } QTEST_MAIN(tst_qdeclarativeecmascript) |