From 53d1e9ed21d25e65a2f13606af479838f5f21fe7 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Wed, 21 Feb 2018 10:16:14 +0200 Subject: tests: Wrap qWaitForWindow{Active,Exposed} in QVERIFY The functions are marked Q_REQUIRED_RESULT, so they give compilation warnings when not handling the bool return value. Failing the test early at an unexpected event is also better behavior anyway. Task-number: QTBUG-66559 Change-Id: I6c4db29379ec01528208c3e4ee54346b4230616c Reviewed-by: Sami Nurmenniemi Reviewed-by: Shawn Rutledge --- tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto/quick/qquickpositioners') diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp index 1b3939401a..25e34b980b 100644 --- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp +++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp @@ -1037,7 +1037,7 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN QQuickItem *positioner = window->rootObject()->findChild(positionerObjectName); QVERIFY(positioner); window->show(); - QTest::qWaitForWindowExposed(window.data()); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); qApp->processEvents(); if (!dynamicallyPopulate && usePopulateTransition) { @@ -1120,7 +1120,7 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName) ctxt->setContextProperty("testedPositioner", QString()); window->setSource(testFileUrl(qmlFile)); window->show(); - QTest::qWaitForWindowExposed(window.data()); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); qApp->processEvents(); QQuickItem *positioner = window->rootObject()->findChild(positionerObjectName); @@ -1243,7 +1243,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName) ctxt->setContextProperty("testedPositioner", QString()); window->setSource(testFileUrl(qmlFile)); window->show(); - QTest::qWaitForWindowExposed(window.data()); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); qApp->processEvents(); QList > expectedDisplacedValues = expectedDisplacedIndexes.getModelDataValues(model); -- cgit v1.2.3