summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-14 07:27:38 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-14 07:27:38 (GMT)
commit16e8a17e7b99e7ff9f818fce79285218141821a1 (patch)
tree093250dfcd61011e4baab8ddaae6425d79edc6c1
parent99804fe10538bf267493d2be679c991f12e0548e (diff)
downloadQt-16e8a17e7b99e7ff9f818fce79285218141821a1.zip
Qt-16e8a17e7b99e7ff9f818fce79285218141821a1.tar.gz
Qt-16e8a17e7b99e7ff9f818fce79285218141821a1.tar.bz2
Deleted context property test
-rw-r--r--tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
index 16f52c5..deaac00 100644
--- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
+++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
@@ -187,12 +187,14 @@ void tst_qmlbindengine::contextPropertiesTriggerReeval()
QmlContext context(engine.rootContext());
MyQmlObject object1;
MyQmlObject object2;
+ MyQmlObject *object3 = new MyQmlObject;
object1.setStringProperty("Hello");
object2.setStringProperty("World");
context.setContextProperty("testProp", QVariant(1));
context.setContextProperty("testObj", &object1);
+ context.setContextProperty("testObj2", object3);
{
MyExpression expr(&context, "testProp + 1");
@@ -233,6 +235,18 @@ void tst_qmlbindengine::contextPropertiesTriggerReeval()
QCOMPARE(expr.changed, true);
QCOMPARE(expr.value(), QVariant("Hello"));
}
+
+ {
+ MyExpression expr(&context, "testObj2");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.value(), QVariant::fromValue((QObject *)object3));
+
+ delete object3;
+
+ QCOMPARE(expr.changed, true);
+ QCOMPARE(expr.value(), QVariant());
+ }
+
}
QTEST_MAIN(tst_qmlbindengine)