summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-04-03 13:57:52 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2018-04-11 06:11:27 +0000
commitedef007137f823cbd92160e3f27d2c83cb4dc2bf (patch)
treeaac4325f1c5dcfc81a8a9fe8ab370a298f655eb3 /tests
parentb318c14bd5ff0ed6ebcb99308271a4ca93795fe8 (diff)
tests/auto/gui/kernel: Use QTRY_VERIFY instead of manual wait loops
This reduces the timeout from 10 seconds to the default 5, but the tested events (resize events, painting) seem like something that should happen in 5 seconds. Change-Id: I1d12372f37264bf7be64096e43813cd03f567102 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp9
-rw-r--r--tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp6
2 files changed, 3 insertions, 12 deletions
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
index a971450ee8..9c36b6898a 100644
--- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
+++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
@@ -156,10 +156,7 @@ void tst_QOpenGLWindow::resize()
// Check that a future resize triggers resizeGL.
w.resize(800, 600);
- int maxWait = 1000;
- while (w.resizeCount == resCount && maxWait-- >= 0)
- QTest::qWait(10);
- QVERIFY(w.resizeCount > resCount);
+ QTRY_VERIFY(w.resizeCount > resCount);
}
class PainterWindow : public QOpenGLWindow
@@ -239,9 +236,7 @@ void tst_QOpenGLWindow::partial()
for (int i = 0; i < 10; ++i) {
w.paintCount = 0;
w.update();
- int maxWait = 1000;
- while (w.paintCount == 0 && maxWait-- >= 0)
- QTest::qWait(10);
+ QTRY_VERIFY(w.paintCount > 0);
}
// Now since the painting went to an extra framebuffer, all the rects should
diff --git a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
index ffc440ac2d..deb4837956 100644
--- a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
+++ b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
@@ -76,11 +76,7 @@ void tst_QRasterWindow::basic()
w.reset();
w.update();
- int maxWait = 1000;
- while (w.paintCount == 0 && --maxWait > 0)
- QTest::qWait(10);
-
- QVERIFY(w.paintCount >= 1);
+ QTRY_VERIFY(w.paintCount >= 1);
}
#include <tst_qrasterwindow.moc>