diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-11 10:04:53 +1000 |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-08-18 22:21:45 +1000 |
commit | 946d1a895e9d7d87b45ae440b533745f35661969 (patch) | |
tree | c151dbac1abb2ea6b05c6995b571edb405912faf /tests | |
parent | 81bb682e280dc282ba965051e232f81f64c1f3fe (diff) |
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
(cherry picked from commit 4026b2c7bc91f8f25f73b182687d5d2bed823217)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 7 |
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 858c26d188..10805b44c7 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); } |