Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update the labeling engine tests
This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
  • Loading branch information
wonder-sk committed Sep 21, 2015
1 parent eabfe02 commit 7d22536
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/src/core/testqgslabelingenginev2.cpp
Expand Up @@ -63,6 +63,8 @@ void TestQgsLabelingEngineV2::testBasic()
mapSettings.setExtent( vl->extent() );
mapSettings.setLayers( QStringList() << vl->id() );

// first render the map and labeling separately

QgsMapRendererSequentialJob job( mapSettings );
job.start();
job.waitForFinished();
Expand All @@ -85,16 +87,15 @@ void TestQgsLabelingEngineV2::testBasic()

p.end();

// TODO: replace with render checker
img.save( "/tmp/tstlabels.png" );

// now let's test the variant when integrated into rendering loop

job.start();
job.waitForFinished();
QImage img2 = job.renderedImage();
img2.save( "/tmp/tstlabels2.png" );

vl->setCustomProperty( "labeling/enabled", false );

QCOMPARE( img, img2 );
}

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

// first render the map and diagrams separately

QgsMapRendererSequentialJob job( mapSettings );
job.start();
job.waitForFinished();
Expand All @@ -126,14 +129,12 @@ void TestQgsLabelingEngineV2::testDiagrams()

p.end();

// TODO: replace with render checker
img.save( "/tmp/tstdiagrams.png" );

// now let's test the variant when integrated into rendering loop
job.start();
job.waitForFinished();
QImage img2 = job.renderedImage();
img2.save( "/tmp/tstdiagrams2.png" );

QCOMPARE( img, img2 );
}

QTEST_MAIN( TestQgsLabelingEngineV2 )
Expand Down

0 comments on commit 7d22536

Please sign in to comment.