summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-04-15 06:15:39 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-04-15 07:13:19 (GMT)
commit59a6e6200984ccbb862b8758436a5e88b8c40bbc (patch)
tree3b3d88949a96edf2932e07a50f6fef0e0f9dba01
parentd6bd4db2db6dbefec327e226bf54a69a20690a45 (diff)
downloadQt-59a6e6200984ccbb862b8758436a5e88b8c40bbc.zip
Qt-59a6e6200984ccbb862b8758436a5e88b8c40bbc.tar.gz
Qt-59a6e6200984ccbb862b8758436a5e88b8c40bbc.tar.bz2
Remove Q_ASSERT from QDeclarativeListModel autotest.
Change-Id: Ic15b747fa50bcec54df748b173b299058f69c681 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
-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 45072f3..14af19c 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -114,7 +114,6 @@ int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model,
if (model->toString(roles[i]) == roleName)
return roles[i];
}
- Q_ASSERT(false);
return -1;
}
@@ -740,6 +739,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);
@@ -801,6 +801,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)
@@ -892,6 +893,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);
@@ -904,6 +906,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);