Stabilize tst_SceneGraph::createTextureFromImage
The test would crash half the time on my laptop due to the scene graph not being initialized and then returning a nullptr for the texture. At that point texture->hasAlphaChannel() crashes. Change-Id: I9220d9bd6abe6381752c26335f2b60fa8d2adccf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
123481f94e
commit
a669a2cd49
|
@ -549,6 +549,7 @@ void tst_SceneGraph::createTextureFromImage()
|
||||||
QQuickView view;
|
QQuickView view;
|
||||||
view.show();
|
view.show();
|
||||||
QTest::qWaitForWindowExposed(&view);
|
QTest::qWaitForWindowExposed(&view);
|
||||||
|
QTRY_VERIFY(view.isSceneGraphInitialized());
|
||||||
|
|
||||||
QScopedPointer<QSGTexture> texture(view.createTextureFromImage(image, (QQuickWindow::CreateTextureOptions) flags));
|
QScopedPointer<QSGTexture> texture(view.createTextureFromImage(image, (QQuickWindow::CreateTextureOptions) flags));
|
||||||
QCOMPARE(texture->hasAlphaChannel(), expectedAlpha);
|
QCOMPARE(texture->hasAlphaChannel(), expectedAlpha);
|
||||||
|
|
Loading…
Reference in New Issue