From 08e083e682d92290e36e4fb09abaf0318575dd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 8 Sep 2017 18:42:25 +0200 Subject: 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 --- tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto/widgets/kernel/qboxlayout') diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp index 0b35db1b5f..bcdd103531 100644 --- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp +++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp @@ -160,7 +160,7 @@ void tst_QBoxLayout::sizeHint() lay1->addLayout(lay2); window.setLayout(lay1); window.show(); - QTest::qWaitForWindowExposed(&window); + QVERIFY(QTest::qWaitForWindowExposed(&window)); label->setText("foooooooo baaaaaaar"); QSize sh = lay1->sizeHint(); QApplication::processEvents(); @@ -181,7 +181,7 @@ void tst_QBoxLayout::sizeConstraints() lay->setSizeConstraint(QLayout::SetFixedSize); window.setLayout(lay); window.show(); - QTest::qWaitForWindowExposed(&window); + QVERIFY(QTest::qWaitForWindowExposed(&window)); QSize sh = window.sizeHint(); delete lay->takeAt(1); QVERIFY(sh.width() >= window.sizeHint().width() && @@ -228,7 +228,7 @@ void tst_QBoxLayout::setStyleShouldChangeSpacing() style1->hspacing = 6; window.setStyle(style1.data()); window.show(); - QTest::qWaitForWindowExposed(&window); + QVERIFY(QTest::qWaitForWindowExposed(&window)); int spacing = pb2->geometry().left() - pb1->geometry().right() - 1; QCOMPARE(spacing, 6); -- cgit v1.2.3