diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-03-05 01:14:38 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-03-05 01:14:38 (GMT) |
commit | af81ea8a5abbd9a94eb6ab5c3fe0425779905d5a (patch) | |
tree | aee7f84f0840ca41c86898e3d8fc2f7e8594c973 /tests/auto | |
parent | fafc3f1689b43c5504e0f5c7f7a661e5ddf82290 (diff) | |
download | Qt-af81ea8a5abbd9a94eb6ab5c3fe0425779905d5a.zip Qt-af81ea8a5abbd9a94eb6ab5c3fe0425779905d5a.tar.gz Qt-af81ea8a5abbd9a94eb6ab5c3fe0425779905d5a.tar.bz2 |
Fix test
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp index 68029bc..20f4ef3 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp +++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp @@ -266,6 +266,8 @@ void tst_qdeclarativexmllistmodel::reload() QCOMPARE(spyRemove[0][0].toInt(), 0); QCOMPARE(spyRemove[0][1].toInt(), 9); + + delete model; } void tst_qdeclarativexmllistmodel::useKeys() @@ -284,7 +286,7 @@ void tst_qdeclarativexmllistmodel::useKeys() QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml")); QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create()); QVERIFY(model != 0); - + model->setXml(oldXml); QTRY_COMPARE(model->count(), oldCount); @@ -319,6 +321,8 @@ void tst_qdeclarativexmllistmodel::useKeys() QCOMPARE(spyRemove[i][0].toInt(), removeRanges[i].first); QCOMPARE(spyRemove[i][1].toInt(), removeRanges[i].second); } + + delete model; } void tst_qdeclarativexmllistmodel::useKeys_data() @@ -448,18 +452,16 @@ void tst_qdeclarativexmllistmodel::noKeysValueChanges() model->setXml(xml); // wait for the new xml data to be set, and verify no signals were emitted - for (int i=0; i<50; i++) { - QTest::qWait(100); - if (model->data(0, model->roles()[2]).toString() != QLatin1String("AussieRules")) - break; - } + QTRY_VERIFY(model->data(0, model->roles()[2]).toString() != QLatin1String("Football")); QCOMPARE(model->data(0, model->roles()[2]).toString(), QLatin1String("AussieRules")); QVERIFY(spyInsert.count() == 0); QVERIFY(spyRemove.count() == 0); QVERIFY(spyCount.count() == 0); - + QCOMPARE(model->count(), 2); + + delete model; } void tst_qdeclarativexmllistmodel::keysChanged() @@ -494,6 +496,8 @@ void tst_qdeclarativexmllistmodel::keysChanged() QCOMPARE(spyRemove[0][1].toInt(), 2); QCOMPARE(spyCount.count(), 0); + + delete model; } QTEST_MAIN(tst_qdeclarativexmllistmodel) |