diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml | 8 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 15 |
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" |