aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/v4
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-11-09 11:09:27 +0000
committerQt by Nokia <qt-info@nokia.com>2011-11-09 13:13:36 +0100
commit1c93b9ce6e180e7beeaae32c524a6726d50939c5 (patch)
tree31fd3b92304ccec14f8f56c624486e125ab594dc /tests/auto/declarative/v4
parent0c5f9185502f3f81265a044955bd13040c2446db (diff)
Fix v4 crash when accessing invalid attached property
Task-number: QTBUG-21883 Change-Id: Ic14a5d494890fc1bc322c660b97f657d640f2ff8 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/declarative/v4')
-rw-r--r--tests/auto/declarative/v4/data/qtbug_21883.qml5
-rw-r--r--tests/auto/declarative/v4/tst_v4.cpp14
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/v4/data/qtbug_21883.qml b/tests/auto/declarative/v4/data/qtbug_21883.qml
new file mode 100644
index 0000000000..a51f97c944
--- /dev/null
+++ b/tests/auto/declarative/v4/data/qtbug_21883.qml
@@ -0,0 +1,5 @@
+import Qt.v4 1.0
+
+Result {
+ property Result dummy: Result
+}
diff --git a/tests/auto/declarative/v4/tst_v4.cpp b/tests/auto/declarative/v4/tst_v4.cpp
index 0b6b2c24f7..20d739f4b5 100644
--- a/tests/auto/declarative/v4/tst_v4.cpp
+++ b/tests/auto/declarative/v4/tst_v4.cpp
@@ -77,6 +77,7 @@ private slots:
void qtscript_data();
void nestedObjectAccess();
void subscriptionsInConditionalExpressions();
+ void qtbug_21883();
private:
QDeclarativeEngine engine;
@@ -239,6 +240,19 @@ void tst_v4::subscriptionsInConditionalExpressions()
delete o;
}
+// Crash test
+void tst_v4::qtbug_21883()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_21883.qml"));
+
+ QString warning = component.url().toString() + ":4: Unable to assign null to ResultObject*";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ delete o;
+}
+
QTEST_MAIN(tst_v4)
#include "tst_v4.moc"