diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-30 15:16:36 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-31 11:50:10 +0000 |
commit | 7b72cc205ccd3e568b59a32a5cd751bd62b42e94 (patch) | |
tree | b6ef774e09a1101c3e9a5cbf18323c369e98a6f6 /tests/auto/widgets/itemviews/qitemview | |
parent | 3859b304e846b4ee8e77350945b6c63bbb487e13 (diff) |
tests/auto/widgets: 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: Ie29640451dddeb58342038a8cd5fac152cce39e5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/itemviews/qitemview')
-rw-r--r-- | tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp index f92eb7c8f9..8fd86ea467 100644 --- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp +++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp @@ -552,7 +552,7 @@ void tst_QItemView::visualRect() QFETCH(bool, displays); if (!displays){ - QVERIFY(view->visualRect(topIndex) == QRect()); + QCOMPARE(view->visualRect(topIndex), QRect()); return; } @@ -560,15 +560,15 @@ void tst_QItemView::visualRect() view->show(); QVERIFY(view->visualRect(topIndex) != QRect()); - QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).center())); - QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).bottomLeft())); - QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).bottomRight())); - QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).topLeft())); - QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).topRight())); + QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).center())); + QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).bottomLeft())); + QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).bottomRight())); + QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).topLeft())); + QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).topRight())); testViews->hideIndexes(view); QModelIndex hiddenIndex = treeModel->index(1, 0); - QVERIFY(view->visualRect(hiddenIndex) == QRect()); + QCOMPARE(view->visualRect(hiddenIndex), QRect()); } void tst_QItemView::walkScreen(QAbstractItemView *view) @@ -616,7 +616,7 @@ void walkIndex(QModelIndex index, QAbstractItemView *view) if (view->indexAt(point) != index) { qDebug() << "index" << index << "visualRect" << visualRect << point << view->indexAt(point); } - QVERIFY(view->indexAt(point) == index); + QCOMPARE(view->indexAt(point), index); } } |