Skip to content
Permalink
Browse files

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 7d22536ab0d53d02f98f7e58152ab816a013588e
Showing with 9 additions and 8 deletions.
  1. +9 −8 tests/src/core/testqgslabelingenginev2.cpp
@@ -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();
@@ -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()
@@ -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();
@@ -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 )

0 comments on commit 7d22536

Please sign in to comment.
You can’t perform that action at this time.