aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-11-30 10:29:06 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-12-08 16:27:12 +0000
commit260f45d539b3ec1b28f593706ce7c164836f814c (patch)
tree737bb18bc4e4eae06fe468e551b66dbde1e08fdd /tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
parent9a3b339e1c3aea4e92149706357e988979593b4d (diff)
tst_QQuickPathView, tst_QQuickListView: Fix compiler warnings
Fix warnings about assignment used as truth value in Q[TRY_]VERIFY by generally pulling out the assignment in case of QVERIFY and adding parentheses in case of QTRY_VERIFY. Also fix 2 cases in which apparently QTRY_VERIFY(find()) was intended. Fixes warnings: tst_qquickpathview.cpp: In member function 'void tst_QQuickPathView::creationContext()': tst_qquickpathview.cpp:1637:100: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquickpathview.cpp: In member function 'void tst_QQuickPathView::currentOffsetOnInsertion()': tst_qquickpathview.cpp:1688:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquickpathview.cpp:1700:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquickpathview.cpp:1712:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::sectionsPositioning()': tst_qquicklistview.cpp:2392:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::itemListFlicker()': tst_qquicklistview.cpp:2979:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2981:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2983:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2988:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2990:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2992:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2997:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2999:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:3001:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::creationContext()': tst_qquicklistview.cpp:5339:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5341:98: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5343:98: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5345:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::unrequestedVisibility()': tst_qquicklistview.cpp:5626:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5628:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5631:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5633:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5636:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5638:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5640:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5642:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5650:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5652:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5663:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5665:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5668:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5670:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5673:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5675:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5677:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5679:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5687:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5690:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5692:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5695:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5697:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5699:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5701:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5707:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5709:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5711:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5713:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5719:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5721:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5723:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5725:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5731:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5733:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5735:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5737:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5743:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5745:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5747:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5749:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::displayMargin()': tst_qquicklistview.cpp:7255:100: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7259:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::negativeDisplayMargin()': tst_qquicklistview.cpp:7292:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7295:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7298:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7303:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Change-Id: Ic069c8336cf15db75860c6f79dfd215a5592ca79 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'tests/auto/quick/qquickpathview/tst_qquickpathview.cpp')
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index d013d190ec..ba3d182efc 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -1633,8 +1633,8 @@ void tst_QQuickPathView::creationContext()
QVERIFY(rootItem);
QVERIFY(rootItem->property("count").toInt() > 0);
- QQuickItem *item;
- QVERIFY(item = findItem<QQuickItem>(rootItem, "listItem", 0));
+ QQuickItem *item = findItem<QQuickItem>(rootItem, "listItem", 0);
+ QVERIFY(item);
QCOMPARE(item->property("text").toString(), QString("Hello!"));
}
@@ -1685,7 +1685,8 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
QCOMPARE(currentIndexSpy.count(), 1);
// currentIndex is now 1
- QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 1));
+ item = findItem<QQuickRectangle>(pathview, "wrapper", 1);
+ QVERIFY(item);
// verify that current item (item 1) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
@@ -1697,7 +1698,8 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
QCOMPARE(currentIndexSpy.count(), 2);
// currentIndex is now 2
- QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 2));
+ item = findItem<QQuickRectangle>(pathview, "wrapper", 2);
+ QVERIFY(item);
// verify that current item (item 2) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
@@ -1709,7 +1711,8 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
QCOMPARE(currentIndexSpy.count(), 3);
// currentIndex is now 1
- QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 1));
+ item = findItem<QQuickRectangle>(pathview, "wrapper", 1);
+ QVERIFY(item);
// verify that current item (item 1) is still at offset 0.5
QCOMPARE(item->position() + offset, start);