aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-06 10:43:34 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-02-06 10:05:03 +0000
commit895302829b46e00cde8eef13eb7c630af5d771e2 (patch)
tree4352bf2b4d752227d3009bb94e36143e08fc315e
parent8ab6ded97633bf7f74e7ca4de35ed56d07f358d8 (diff)
Try to stabilize tst_qquickwindow::defaultSurfaceFormat
Apparently the OpenGL context is not guaranteed to be available right after showing the window. Wait for it to appear. Change-Id: Ie3acdb857d4e3a8c6c148c57916a49a58c93a835 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index ab101dc1be..a862604fc1 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -2350,8 +2350,10 @@ void tst_qquickwindow::defaultSurfaceFormat()
// Depth and stencil should be >= what has been requested. For real. But use
// the context since the window's surface format is only partially updated
// on most platforms.
- QVERIFY(window.openglContext()->format().depthBufferSize() >= 16);
- QVERIFY(window.openglContext()->format().stencilBufferSize() >= 8);
+ const QOpenGLContext *openglContext = nullptr;
+ QTRY_VERIFY((openglContext = window.openglContext()) != nullptr);
+ QVERIFY(openglContext->format().depthBufferSize() >= 16);
+ QVERIFY(openglContext->format().stencilBufferSize() >= 8);
#endif
QSurfaceFormat::setDefaultFormat(savedDefaultFormat);
}