Skip to content

Commit 0bfe501

Browse files
committedJul 26, 2018
Finish Travis hacks
1 parent 4b88bfb commit 0bfe501

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed
 

‎tests/src/3d/testqgs3drendering.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,13 @@ void TestQgs3DRendering::testFlatTerrain()
127127

128128
// look from the top
129129
scene->cameraController()->setLookingAtPoint( QgsVector3D( 0, 0, 0 ), 2500, 0, 0 );
130+
131+
// When running the test on Travis, it would initially return empty rendered image.
132+
// Capturing the initial image and throwing it away fixes that. Hopefully we will
133+
// find a better fix in the future.
134+
Qgs3DUtils::captureSceneImage( engine, scene );
135+
130136
QImage img = Qgs3DUtils::captureSceneImage( engine, scene );
131-
//QTest::qSleep( 100 ); // a hack to avoid blank render on Travis
132-
img = Qgs3DUtils::captureSceneImage( engine, scene );
133137
QVERIFY( renderCheck( "flat_terrain_1", img, 40 ) );
134138

135139
// tilted view (pitch = 60 degrees)
@@ -162,9 +166,13 @@ void TestQgs3DRendering::testDemTerrain()
162166
engine.setRootEntity( scene );
163167

164168
scene->cameraController()->setLookingAtPoint( QgsVector3D( 0, 0, 0 ), 2000, 60, 0 );
169+
170+
// When running the test on Travis, it would initially return empty rendered image.
171+
// Capturing the initial image and throwing it away fixes that. Hopefully we will
172+
// find a better fix in the future.
173+
Qgs3DUtils::captureSceneImage( engine, scene );
174+
165175
QImage img3 = Qgs3DUtils::captureSceneImage( engine, scene );
166-
QTest::qSleep( 100 ); // a hack to avoid blank render on Travis
167-
img3 = Qgs3DUtils::captureSceneImage( engine, scene );
168176

169177
QVERIFY( renderCheck( "dem_terrain_1", img3, 40 ) );
170178
}

0 commit comments

Comments
 (0)
Please sign in to comment.