Quick item view tests: fix compile warning

Don't use QCOMPARE for a true/false test, use QVERIFY. This conveniently
fixes the (bogus, perhaps) compiler warning with MSVC about comparing
a quint32 (the underlying type of the polishScheduled bitfield) with a
bool.

Pick-to: 6.5
Change-Id: Ib273ee30906e09955e849e65af2b7ff8ce3e2512
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-04-16 13:31:52 +02:00
parent 5ba3db2126
commit 77886b496d
2 changed files with 2 additions and 2 deletions

View File

@ -2740,7 +2740,7 @@ void tst_QQuickListView::sectionsSnap()
QTRY_VERIFY(listview != nullptr);
listview->setSnapMode(snapMode);
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
QTRY_VERIFY(!QQuickItemPrivate::get(listview)->polishScheduled);
QTRY_COMPARE(listview->currentIndex(), 0);
QCOMPARE(listview->contentY(), qreal(-50));

View File

@ -2453,7 +2453,7 @@ void tst_QQuickTableView::checkChangingModelFromDelegate()
// And since the QML code tried to add another row as well, we
// expect rebuildScheduled to be true, and a polish event to be pending.
QVERIFY(tableViewPrivate->scheduledRebuildOptions);
QCOMPARE(tableViewPrivate->polishScheduled, true);
QVERIFY(tableViewPrivate->polishScheduled);
WAIT_UNTIL_POLISHED;
// After handling the polish event, we expect also the third row to now be added