summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-02-28 12:57:51 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2018-03-01 09:38:19 +0000
commit233046d39c0add19b185765548a22f7131ea347a (patch)
tree9bdac0d52d883173fa0135ab4d2e81b9e41e3c7e
parent1875db1849acd074d09c1f0328a1db5290422b2f (diff)
tst_QAbstractItemView: Wrap qWaitForWindowActive in QVERIFY
Return value of qWaitForWindowActive should be checked as it is marked Q_REQUIRED_RESULT. One of the calls was failing, so remove it and wait for the next condition instead. Amends d0dffdfc012574da4a75241097b667d09bb39ba2. Change-Id: I0c0b2bf11504730477158a5e1fb3018f359a6fb9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 4723221293..da52a7ea27 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -2502,7 +2502,7 @@ void tst_QAbstractItemView::checkFocusAfterActivationChanges()
view->setItemDelegate(&delegate);
w.show();
- QTest::qWaitForWindowActive(&w);
+ QVERIFY(QTest::qWaitForWindowActive(&w));
QVERIFY(le->hasFocus());
view->setFocus();
@@ -2513,12 +2513,11 @@ void tst_QAbstractItemView::checkFocusAfterActivationChanges()
QVERIFY(delegate.openedEditor->hasFocus());
QApplication::setActiveWindow(&otherTopLevel);
- QTest::qWaitForWindowActive(&otherTopLevel);
otherTopLevel.setFocus();
- QVERIFY(!delegate.openedEditor);
+ QTRY_VERIFY(!delegate.openedEditor);
QApplication::setActiveWindow(&w);
- QTest::qWaitForWindowActive(&w);
+ QVERIFY(QTest::qWaitForWindowActive(&w));
QVERIFY(view->hasFocus());
}