From 895302829b46e00cde8eef13eb7c630af5d771e2 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 6 Feb 2019 10:43:34 +0100 Subject: 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 --- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/auto/quick') 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); } -- cgit v1.2.3