summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp18
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)