@@ -63,6 +63,8 @@ void TestQgsLabelingEngineV2::testBasic()
63
63
mapSettings.setExtent ( vl->extent () );
64
64
mapSettings.setLayers ( QStringList () << vl->id () );
65
65
66
+ // first render the map and labeling separately
67
+
66
68
QgsMapRendererSequentialJob job ( mapSettings );
67
69
job.start ();
68
70
job.waitForFinished ();
@@ -85,16 +87,15 @@ void TestQgsLabelingEngineV2::testBasic()
85
87
86
88
p.end ();
87
89
88
- // TODO: replace with render checker
89
- img.save ( " /tmp/tstlabels.png" );
90
-
91
90
// now let's test the variant when integrated into rendering loop
91
+
92
92
job.start ();
93
93
job.waitForFinished ();
94
94
QImage img2 = job.renderedImage ();
95
- img2.save ( " /tmp/tstlabels2.png" );
96
95
97
96
vl->setCustomProperty ( " labeling/enabled" , false );
97
+
98
+ QCOMPARE ( img, img2 );
98
99
}
99
100
100
101
void TestQgsLabelingEngineV2::testDiagrams ()
@@ -105,6 +106,8 @@ void TestQgsLabelingEngineV2::testDiagrams()
105
106
mapSettings.setExtent ( vl->extent () );
106
107
mapSettings.setLayers ( QStringList () << vl->id () );
107
108
109
+ // first render the map and diagrams separately
110
+
108
111
QgsMapRendererSequentialJob job ( mapSettings );
109
112
job.start ();
110
113
job.waitForFinished ();
@@ -126,14 +129,12 @@ void TestQgsLabelingEngineV2::testDiagrams()
126
129
127
130
p.end ();
128
131
129
- // TODO: replace with render checker
130
- img.save ( " /tmp/tstdiagrams.png" );
131
-
132
132
// now let's test the variant when integrated into rendering loop
133
133
job.start ();
134
134
job.waitForFinished ();
135
135
QImage img2 = job.renderedImage ();
136
- img2.save ( " /tmp/tstdiagrams2.png" );
136
+
137
+ QCOMPARE ( img, img2 );
137
138
}
138
139
139
140
QTEST_MAIN ( TestQgsLabelingEngineV2 )
0 commit comments