aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllistmodelworkerscript
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-24 15:27:58 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-29 09:44:39 +0000
commit0ea3c24cfe7d1057964fe864924a7ee083764084 (patch)
tree681b7df0a201641203c936e748afd7d6a7ec39b5 /tests/auto/qml/qqmllistmodelworkerscript
parentbb87365ffabcba3a70dd49a4c3232a12b5b224a3 (diff)
tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/qqmllistmodelworkerscript')
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
index 5bf75d41d4..0ad2963265 100644
--- a/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
+++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
@@ -647,15 +647,15 @@ void tst_qqmllistmodelworkerscript::worker_sync()
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
- QVERIFY(model.count() == 0);
+ QCOMPARE(model.count(), 0);
QVERIFY(QMetaObject::invokeMethod(item, "addItem0"));
- QVERIFY(model.count() == 2);
+ QCOMPARE(model.count(), 2);
QVariant childData = model.data(0, 0);
QQmlListModel *childModel = qobject_cast<QQmlListModel *>(childData.value<QObject *>());
QVERIFY(childModel);
- QVERIFY(childModel->count() == 1);
+ QCOMPARE(childModel->count(), 1);
QSignalSpy spyModelInserted(&model, SIGNAL(rowsInserted(QModelIndex,int,int)));
QSignalSpy spyChildInserted(childModel, SIGNAL(rowsInserted(QModelIndex,int,int)));
@@ -663,34 +663,34 @@ void tst_qqmllistmodelworkerscript::worker_sync()
QVERIFY(QMetaObject::invokeMethod(item, "addItemViaWorker"));
waitForWorker(item);
- QVERIFY(model.count() == 2);
- QVERIFY(childModel->count() == 1);
- QVERIFY(spyModelInserted.count() == 0);
- QVERIFY(spyChildInserted.count() == 0);
+ QCOMPARE(model.count(), 2);
+ QCOMPARE(childModel->count(), 1);
+ QCOMPARE(spyModelInserted.count(), 0);
+ QCOMPARE(spyChildInserted.count(), 0);
QVERIFY(QMetaObject::invokeMethod(item, "doSync"));
waitForWorker(item);
- QVERIFY(model.count() == 2);
- QVERIFY(childModel->count() == 2);
- QVERIFY(spyModelInserted.count() == 0);
- QVERIFY(spyChildInserted.count() == 1);
+ QCOMPARE(model.count(), 2);
+ QCOMPARE(childModel->count(), 2);
+ QCOMPARE(spyModelInserted.count(), 0);
+ QCOMPARE(spyChildInserted.count(), 1);
QVERIFY(QMetaObject::invokeMethod(item, "addItemViaWorker"));
waitForWorker(item);
- QVERIFY(model.count() == 2);
- QVERIFY(childModel->count() == 2);
- QVERIFY(spyModelInserted.count() == 0);
- QVERIFY(spyChildInserted.count() == 1);
+ QCOMPARE(model.count(), 2);
+ QCOMPARE(childModel->count(), 2);
+ QCOMPARE(spyModelInserted.count(), 0);
+ QCOMPARE(spyChildInserted.count(), 1);
QVERIFY(QMetaObject::invokeMethod(item, "doSync"));
waitForWorker(item);
- QVERIFY(model.count() == 2);
- QVERIFY(childModel->count() == 3);
- QVERIFY(spyModelInserted.count() == 0);
- QVERIFY(spyChildInserted.count() == 2);
+ QCOMPARE(model.count(), 2);
+ QCOMPARE(childModel->count(), 3);
+ QCOMPARE(spyModelInserted.count(), 0);
+ QCOMPARE(spyChildInserted.count(), 2);
delete item;
qApp->processEvents();
@@ -714,24 +714,24 @@ void tst_qqmllistmodelworkerscript::worker_remove_element()
QSignalSpy spyModelRemoved(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
- QVERIFY(model.count() == 0);
- QVERIFY(spyModelRemoved.count() == 0);
+ QCOMPARE(model.count(), 0);
+ QCOMPARE(spyModelRemoved.count(), 0);
QVERIFY(QMetaObject::invokeMethod(item, "addItem"));
- QVERIFY(model.count() == 1);
+ QCOMPARE(model.count(), 1);
QVERIFY(QMetaObject::invokeMethod(item, "removeItemViaWorker"));
waitForWorker(item);
- QVERIFY(model.count() == 1);
- QVERIFY(spyModelRemoved.count() == 0);
+ QCOMPARE(model.count(), 1);
+ QCOMPARE(spyModelRemoved.count(), 0);
QVERIFY(QMetaObject::invokeMethod(item, "doSync"));
waitForWorker(item);
- QVERIFY(model.count() == 0);
- QVERIFY(spyModelRemoved.count() == 1);
+ QCOMPARE(model.count(), 0);
+ QCOMPARE(spyModelRemoved.count(), 1);
delete item;
qApp->processEvents();
@@ -747,7 +747,7 @@ void tst_qqmllistmodelworkerscript::worker_remove_element()
QVERIFY(QMetaObject::invokeMethod(item, "addItem"));
- QVERIFY(model->count() == 1);
+ QCOMPARE(model->count(), 1);
QVERIFY(QMetaObject::invokeMethod(item, "removeItemViaWorker"));
QVERIFY(QMetaObject::invokeMethod(item, "doSync"));
@@ -777,24 +777,24 @@ void tst_qqmllistmodelworkerscript::worker_remove_list()
QSignalSpy spyModelRemoved(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
- QVERIFY(model.count() == 0);
- QVERIFY(spyModelRemoved.count() == 0);
+ QCOMPARE(model.count(), 0);
+ QCOMPARE(spyModelRemoved.count(), 0);
QVERIFY(QMetaObject::invokeMethod(item, "addList"));
- QVERIFY(model.count() == 1);
+ QCOMPARE(model.count(), 1);
QVERIFY(QMetaObject::invokeMethod(item, "removeListViaWorker"));
waitForWorker(item);
- QVERIFY(model.count() == 1);
- QVERIFY(spyModelRemoved.count() == 0);
+ QCOMPARE(model.count(), 1);
+ QCOMPARE(spyModelRemoved.count(), 0);
QVERIFY(QMetaObject::invokeMethod(item, "doSync"));
waitForWorker(item);
- QVERIFY(model.count() == 0);
- QVERIFY(spyModelRemoved.count() == 1);
+ QCOMPARE(model.count(), 0);
+ QCOMPARE(spyModelRemoved.count(), 1);
delete item;
qApp->processEvents();