From 233046d39c0add19b185765548a22f7131ea347a Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Wed, 28 Feb 2018 12:57:51 +0200 Subject: [PATCH] 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 --- .../itemviews/qabstractitemview/tst_qabstractitemview.cpp | 7 +++---- 1 file 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()); }