Skip to content

Commit 7d22536

Browse files
committedSep 21, 2015
Update the labeling engine tests
This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
1 parent eabfe02 commit 7d22536

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
 

‎tests/src/core/testqgslabelingenginev2.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ void TestQgsLabelingEngineV2::testBasic()
6363
mapSettings.setExtent( vl->extent() );
6464
mapSettings.setLayers( QStringList() << vl->id() );
6565

66+
// first render the map and labeling separately
67+
6668
QgsMapRendererSequentialJob job( mapSettings );
6769
job.start();
6870
job.waitForFinished();
@@ -85,16 +87,15 @@ void TestQgsLabelingEngineV2::testBasic()
8587

8688
p.end();
8789

88-
// TODO: replace with render checker
89-
img.save( "/tmp/tstlabels.png" );
90-
9190
// now let's test the variant when integrated into rendering loop
91+
9292
job.start();
9393
job.waitForFinished();
9494
QImage img2 = job.renderedImage();
95-
img2.save( "/tmp/tstlabels2.png" );
9695

9796
vl->setCustomProperty( "labeling/enabled", false );
97+
98+
QCOMPARE( img, img2 );
9899
}
99100

100101
void TestQgsLabelingEngineV2::testDiagrams()
@@ -105,6 +106,8 @@ void TestQgsLabelingEngineV2::testDiagrams()
105106
mapSettings.setExtent( vl->extent() );
106107
mapSettings.setLayers( QStringList() << vl->id() );
107108

109+
// first render the map and diagrams separately
110+
108111
QgsMapRendererSequentialJob job( mapSettings );
109112
job.start();
110113
job.waitForFinished();
@@ -126,14 +129,12 @@ void TestQgsLabelingEngineV2::testDiagrams()
126129

127130
p.end();
128131

129-
// TODO: replace with render checker
130-
img.save( "/tmp/tstdiagrams.png" );
131-
132132
// now let's test the variant when integrated into rendering loop
133133
job.start();
134134
job.waitForFinished();
135135
QImage img2 = job.renderedImage();
136-
img2.save( "/tmp/tstdiagrams2.png" );
136+
137+
QCOMPARE( img, img2 );
137138
}
138139

139140
QTEST_MAIN( TestQgsLabelingEngineV2 )

0 commit comments

Comments
 (0)