summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativelistmodel
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-11 00:04:53 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-11 00:04:53 (GMT)
commit4026b2c7bc91f8f25f73b182687d5d2bed823217 (patch)
tree974de988773e05fdceb4318a362eed35a691f658 /tests/auto/declarative/qdeclarativelistmodel
parent27b5da4ff5a762df0ab3e98ecde9dac4aa589178 (diff)
downloadQt-4026b2c7bc91f8f25f73b182687d5d2bed823217.zip
Qt-4026b2c7bc91f8f25f73b182687d5d2bed823217.tar.gz
Qt-4026b2c7bc91f8f25f73b182687d5d2bed823217.tar.bz2
Don't destroy ListModel child list nodes.
These are owned by the root and must not be destroyed by child lists. Task-number: QTBUG-12771 Reviewed-by: Bea Lam
Diffstat (limited to 'tests/auto/declarative/qdeclarativelistmodel')
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 858c26d..10805b4 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -271,6 +271,9 @@ void tst_qdeclarativelistmodel::dynamic_data()
QTest::newRow("nested-insert") << "{append({'foo':123});insert(0,{'bars':[{'a':1},{'b':2},{'c':3}]});get(0).bars.get(0).a}" << 1 << "";
QTest::newRow("nested-set") << "{append({'foo':123});set(0,{'foo':[{'x':123}]});get(0).foo.get(0).x}" << 123 << "";
+ QTest::newRow("nested-count") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.count}" << 3 << "";
+ QTest::newRow("nested-clear") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.clear(); get(0).bars.count}" << 0 << "";
+
// XXX
//QTest::newRow("nested-setprop") << "{append({'foo':123});setProperty(0,'foo',[{'x':123}]);get(0).foo.get(0).x}" << 123 << "";
}
@@ -344,9 +347,7 @@ void tst_qdeclarativelistmodel::dynamic_worker()
waitForWorker(item);
QDeclarativeExpression e(eng.rootContext(), &model, operations.last().toString());
- if (QByteArray(QTest::currentDataTag()).startsWith("nested"))
- QVERIFY(e.evaluate().toInt() != result);
- else
+ if (!QByteArray(QTest::currentDataTag()).startsWith("nested"))
QCOMPARE(e.evaluate().toInt(), result);
}