diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-09-08 18:42:25 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-10-05 15:15:36 +0000 |
commit | 08e083e682d92290e36e4fb09abaf0318575dd41 (patch) | |
tree | 015d723565961179f8dad65b97ae3919d0158b17 /tests/auto/widgets/itemviews/qtreeview | |
parent | 7bbb9a8ce81653b1665c9c942cc707ce98f611c5 (diff) |
Ensure result of all QTest::qWaitFor are verified
The qWaitFor functions themselves can not trigger a test failure, as that
will not result in the test function exiting early, so every single call
to qWaitFor needs to be wrapped in a QVERIFY.
Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/widgets/itemviews/qtreeview')
-rw-r--r-- | tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index 45d33df356..b4adb84cd1 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -4238,7 +4238,7 @@ void tst_QTreeView::testInitialFocus() treeWidget.header()->hideSection(0); // make sure we skip hidden section(s) treeWidget.header()->swapSections(1, 2); // make sure that we look for first visual index (and not first logical) treeWidget.show(); - QTest::qWaitForWindowExposed(&treeWidget); + QVERIFY(QTest::qWaitForWindowExposed(&treeWidget)); QApplication::processEvents(); QCOMPARE(treeWidget.currentIndex().column(), 2); } @@ -4261,7 +4261,7 @@ void tst_QTreeView::quickExpandCollapse() QVERIFY(rootIndex.isValid()); tree.show(); - QTest::qWaitForWindowExposed(&tree); + QVERIFY(QTest::qWaitForWindowExposed(&tree)); const QAbstractItemView::State initialState = tree.state(); @@ -4455,7 +4455,7 @@ void tst_QTreeView::statusTip() QSize(500, 500))); mw.show(); qApp->setActiveWindow(&mw); - QTest::qWaitForWindowActive(&mw); + QVERIFY(QTest::qWaitForWindowActive(&mw)); // Ensure it is moved away first and then moved to the relevant section QTest::mouseMove(mw.windowHandle(), view->mapTo(&mw, view->rect().bottomLeft() + QPoint(20, 20))); QPoint centerPoint = view->viewport()->mapTo(&mw, view->visualRect(model.index(0, 0)).center()); |