Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
Qt 3D Studio 2.8
-
None
Description
testTextureQuery autotest in tst_q3dssurfaceviewer.cpp fails on Linux with textureID = 0.
If we add a QTest::qWait(100) after window creation AND scale mode change, the test passes.
If the wait is added after window creation but before scale mode change, the returned textureId is valid, but incorrect.
This passes:
void tst_Q3DSSurfaceViewer::testTextureQuery() { QFETCH(bool, isWindow); if (isWindow) createWindowAndViewer(m_viewer, DATAINPUT); else createOffscreenAndViewer(m_viewer, DATAINPUT); m_viewer->settings()->setScaleMode(Q3DSViewerSettings::ScaleModeFill); QTest::qWait(100); // <<< WAIT QGuiApplication::processEvents(); // Test texture info getters, first for layer then for individual material. // Texture id's are likely to change if test ordering changes. QSize texsize; GLenum format; uint textureid = m_viewer->presentation()->textureId("Scene.Layer", texsize, format); if (isWindow) QCOMPARE(textureid, 6); else QCOMPARE(textureid, 7); ...
This fails with textureId = 0:
void tst_Q3DSSurfaceViewer::testTextureQuery() { QFETCH(bool, isWindow); if (isWindow) createWindowAndViewer(m_viewer, DATAINPUT); else createOffscreenAndViewer(m_viewer, DATAINPUT); m_viewer->settings()->setScaleMode(Q3DSViewerSettings::ScaleModeFill); QGuiApplication::processEvents(); // Test texture info getters, first for layer then for individual material. // Texture id's are likely to change if test ordering changes. QSize texsize; GLenum format; uint textureid = m_viewer->presentation()->textureId("Scene.Layer", texsize, format); if (isWindow) QCOMPARE(textureid, 6); else QCOMPARE(textureid, 7); ...
..and this fails with textureId = 5:
void tst_Q3DSSurfaceViewer::testTextureQuery() { QFETCH(bool, isWindow); if (isWindow) createWindowAndViewer(m_viewer, DATAINPUT); else createOffscreenAndViewer(m_viewer, DATAINPUT); QTest::qWait(100); // <<< WAIT m_viewer->settings()->setScaleMode(Q3DSViewerSettings::ScaleModeFill); QGuiApplication::processEvents(); // Test texture info getters, first for layer then for individual material. // Texture id's are likely to change if test ordering changes. QSize texsize; GLenum format; uint textureid = m_viewer->presentation()->textureId("Scene.Layer", texsize, format); if (isWindow) QCOMPARE(textureid, 6); else QCOMPARE(textureid, 7); ...