summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-05-20 04:35:07 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-05-20 04:37:56 (GMT)
commit1057b0a334c9ac7e7e1f3287935fad06de423108 (patch)
treeb5f577dd6176e6c9698fe24aa5df281befc20357 /tests/auto/declarative
parente75088323ae15604139ddfd66b85cc3b8d43abeb (diff)
downloadQt-1057b0a334c9ac7e7e1f3287935fad06de423108.zip
Qt-1057b0a334c9ac7e7e1f3287935fad06de423108.tar.gz
Qt-1057b0a334c9ac7e7e1f3287935fad06de423108.tar.bz2
Add XmlListModel::errorString()
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
index 4173a44..7769979 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
@@ -268,10 +268,12 @@ void tst_qdeclarativexmllistmodel::xml()
QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
QSignalSpy spy(model, SIGNAL(statusChanged(QDeclarativeXmlListModel::Status)));
+ QVERIFY(model->errorString().isEmpty());
QCOMPARE(model->progress(), qreal(0.0));
QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
QTRY_COMPARE(spy.count(), 1); spy.clear();
QCOMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
QCOMPARE(model->progress(), qreal(1.0));
QCOMPARE(model->count(), 9);
@@ -284,6 +286,7 @@ void tst_qdeclarativexmllistmodel::xml()
QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
QTRY_COMPARE(spy.count(), 1); spy.clear();
QCOMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
QCOMPARE(model->count(), count);
delete model;
@@ -309,10 +312,12 @@ void tst_qdeclarativexmllistmodel::source()
QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
QSignalSpy spy(model, SIGNAL(statusChanged(QDeclarativeXmlListModel::Status)));
+ QVERIFY(model->errorString().isEmpty());
QCOMPARE(model->progress(), qreal(0.0));
QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
QTRY_COMPARE(spy.count(), 1); spy.clear();
QCOMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
QCOMPARE(model->progress(), qreal(1.0));
QCOMPARE(model->count(), 9);
@@ -320,6 +325,7 @@ void tst_qdeclarativexmllistmodel::source()
QCOMPARE(model->progress(), qreal(0.0));
QTRY_COMPARE(spy.count(), 1); spy.clear();
QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
+ QVERIFY(model->errorString().isEmpty());
QEventLoop loop;
QTimer timer;
@@ -337,9 +343,12 @@ void tst_qdeclarativexmllistmodel::source()
QCOMPARE(model->status(), status);
QCOMPARE(model->count(), count);
+
if (status == QDeclarativeXmlListModel::Ready)
QCOMPARE(model->progress(), qreal(1.0));
+ QCOMPARE(model->errorString().isEmpty(), status == QDeclarativeXmlListModel::Ready);
+
delete model;
}