summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt10
-rw-r--r--tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt9
-rw-r--r--tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp22
3 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt b/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt
new file mode 100644
index 0000000..2687465
--- /dev/null
+++ b/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.1.txt
@@ -0,0 +1,10 @@
+MyQmlObject {
+ objectProperty: if(1) OtherObject
+
+ property var obj
+
+ obj: Object {
+ id: OtherObject
+ }
+}
+
diff --git a/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt b/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt
new file mode 100644
index 0000000..4aa20ae
--- /dev/null
+++ b/tests/auto/declarative/qmlbindengine/idShortcutInvalidates.txt
@@ -0,0 +1,9 @@
+MyQmlObject {
+ objectProperty: OtherObject
+
+ property var obj
+
+ obj: Object {
+ id: OtherObject
+ }
+}
diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
index dd82d4f..a0554f3 100644
--- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
+++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
@@ -15,6 +15,7 @@ public:
tst_qmlbindengine() {}
private slots:
+ void idShortcutInvalidates();
void boolPropertiesEvaluateAsBool();
void methods();
void signalAssignment();
@@ -29,6 +30,27 @@ private:
QmlEngine engine;
};
+void tst_qmlbindengine::idShortcutInvalidates()
+{
+ {
+ QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.txt"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->objectProperty() != 0);
+ delete object->objectProperty();
+ QVERIFY(object->objectProperty() == 0);
+ }
+
+ {
+ QmlComponent component(&engine, TEST_FILE("idShortcutInvalidates.1.txt"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->objectProperty() != 0);
+ delete object->objectProperty();
+ QVERIFY(object->objectProperty() == 0);
+ }
+}
+
void tst_qmlbindengine::boolPropertiesEvaluateAsBool()
{
{