summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-08 04:26:18 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-08 04:26:18 (GMT)
commitd265b449325ef60624640f80f9438ac63547c1a8 (patch)
tree739a8e104e4db2bb5e26254ddc6a9ccce79f82a5 /tests/auto
parent0bb82245f83b47adf654d34d3e273dad1e39bd27 (diff)
downloadQt-d265b449325ef60624640f80f9438ac63547c1a8.zip
Qt-d265b449325ef60624640f80f9438ac63547c1a8.tar.gz
Qt-d265b449325ef60624640f80f9438ac63547c1a8.tar.bz2
Fix crash
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml8
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp15
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml b/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml
new file mode 100644
index 0000000..8ff3aeb
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+import Qt 4.6
+
+Object {
+ property MyExtendedObject a;
+ a: MyExtendedObject { id: Root }
+ property int b: Math.max(Root.extendedProperty, 0)
+}
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index 6bc88c0..dde3bb7 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -60,6 +60,7 @@ private slots:
void dynamicDestruction();
void objectToString();
void selfDeletingBinding();
+ void extendedObjectPropertyLookup();
private:
QmlEngine engine;
@@ -709,6 +710,20 @@ void tst_qmlecmascript::selfDeletingBinding()
}
}
+/*
+Test that extended object properties can be accessed.
+
+This test a regression where this used to crash. The issue was specificially
+for extended objects that did not include a synthesized meta object (so non-root
+and no synthesiszed properties).
+*/
+void tst_qmlecmascript::extendedObjectPropertyLookup()
+{
+ QmlComponent component(&engine, TEST_FILE("extendedObjectPropertyLookup.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
QTEST_MAIN(tst_qmlecmascript)
#include "tst_qmlecmascript.moc"