aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-04-15 16:15:39 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-05-18 10:59:11 +1000
commitd4ccaaa83aa97ae4e04af91aa94f83a0a8a588e7 (patch)
tree45745bc300319d63b7221cebbc99ee5ce62dab7b
parentafdaa492ea14167376f2bbf19b475a9277124377 (diff)
Remove Q_ASSERT from QDeclarativeListModel autotest.
Change-Id: Ic15b747fa50bcec54df748b173b299058f69c681 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit 59a6e6200984ccbb862b8758436a5e88b8c40bbc)
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index cf053e5fb0..fa5dcc44c0 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -115,7 +115,6 @@ int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model,
if (model->toString(roles[i]) == roleName)
return roles[i];
}
- Q_ASSERT(false);
return -1;
}
@@ -741,6 +740,7 @@ void tst_qdeclarativelistmodel::get()
"}", QUrl());
QDeclarativeListModel *model = qobject_cast<QDeclarativeListModel*>(component.create());
int role = roleFromName(model, roleName);
+ QVERIFY(role >= 0);
QSignalSpy spy(model, SIGNAL(itemsChanged(int, int, QList<int>)));
QDeclarativeExpression expr(eng.rootContext(), model, expression);
@@ -804,6 +804,7 @@ void tst_qdeclarativelistmodel::get_worker()
model.append(sv);
model.append(sv);
int role = roleFromName(&model, roleName);
+ QVERIFY(role >= 0);
const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map)
@@ -895,6 +896,7 @@ void tst_qdeclarativelistmodel::get_nested()
int outerListIndex = testData[i].first;
QString outerListRoleName = testData[i].second;
int outerListRole = roleFromName(model, outerListRoleName);
+ QVERIFY(outerListRole >= 0);
childModel = qobject_cast<QDeclarativeListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
QVERIFY(childModel);
@@ -907,6 +909,7 @@ void tst_qdeclarativelistmodel::get_nested()
QVERIFY(!expr.hasError());
int role = roleFromName(childModel, roleName);
+ QVERIFY(role >= 0);
QCOMPARE(childModel->data(index, role), roleValue);
QCOMPARE(spy.count(), 1);