summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp b/tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp
index d5bfda500a..0f8c5bcf66 100644
--- a/tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp
+++ b/tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp
@@ -161,17 +161,31 @@ void tst_qdeclarativev4::unnecessaryReeval()
void tst_qdeclarativev4::logicalOr()
{
- QDeclarativeComponent component(&engine, TEST_FILE("logicalOr.qml"));
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("logicalOr.qml"));
- QObject *o = component.create();
- QVERIFY(o != 0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
- ResultObject *ro = qobject_cast<ResultObject *>(o);
- QVERIFY(ro != 0);
+ ResultObject *ro = qobject_cast<ResultObject *>(o);
+ QVERIFY(ro != 0);
- QCOMPARE(ro->result(), 0);
+ QCOMPARE(ro->result(), 0);
+ delete o;
+ }
- delete o;
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("logicalOr.2.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ ResultObject *ro = qobject_cast<ResultObject *>(o);
+ QVERIFY(ro != 0);
+
+ QCOMPARE(ro->result(), 1);
+ delete o;
+ }
}
// This would previously use the metaObject of the root element to result the nested access.