Skip to content
Permalink
Browse files

More test updates

  • Loading branch information
nyalldawson committed Dec 21, 2019
1 parent f44c229 commit 322eb3139fa1ba8008b6285631cf754960cb5df0
Showing with 9 additions and 9 deletions.
  1. +5 −5 tests/src/core/testqgslabelingengine.cpp
  2. +1 −1 tests/src/core/testqgsmaprendererjob.cpp
  3. +2 −2 tests/src/core/testqgsmaprotation.cpp
  4. +1 −1 tests/src/python/test_qgsserver_wms_getmap.py
  5. BIN ...abelingengine/expected_label_curved_label_above_1/{ → v1}/expected_label_curved_label_above_1.png
  6. BIN ...ges/labelingengine/expected_label_curved_label_above_1/v2/expected_label_curved_label_above_1.png
  7. BIN ...abelingengine/expected_label_curved_label_below_1/{ → v1}/expected_label_curved_label_below_1.png
  8. BIN ...ges/labelingengine/expected_label_curved_label_below_1/v2/expected_label_curved_label_below_1.png
  9. BIN ...ne/expected_label_curved_label_small_segments/expected_label_curved_label_small_segments_mask.png
  10. BIN ...ngengine/expected_label_curved_negative_distance/expected_label_curved_negative_distance_mask.png
  11. BIN ...rol_images/labelingengine/expected_label_curved_overrun/{ → v1}/expected_label_curved_overrun.png
  12. BIN .../control_images/labelingengine/expected_label_curved_overrun/v2/expected_label_curved_overrun.png
  13. BIN ...xpected_label_curved_small_feature_centered/expected_label_curved_small_feature_centered_mask.png
  14. BIN ...ne/expected_label_multipart_touching_branches/expected_label_multipart_touching_branches_mask.png
  15. BIN ...ngengine/expected_label_multipart_touching_lines/expected_label_multipart_touching_lines_mask.png
  16. BIN ...ted_label_repeat_distance_with_small_line/expected_label_repeat_distance_with_small_line_mask.png
  17. BIN ...ing_rotation_based_orientation_line/{ → v1}/expected_labeling_rotation_based_orientation_line.png
  18. BIN ...labeling_rotation_based_orientation_line/v2/expected_labeling_rotation_based_orientation_line.png
  19. BIN ...trol_images/labelingengine/expected_parallel_prefer_above/expected_parallel_prefer_above_mask.png
  20. BIN ...expected_staged_render_lines_staged_labels/{ → v1}/expected_staged_render_lines_staged_labels.png
  21. BIN ...erer/expected_staged_render_lines_staged_labels/v2/expected_staged_render_lines_staged_labels.png
  22. BIN ..._images/maprotation/expected_lines-parallel-label+45/{ → v1}/expected_lines-parallel-label+45.png
  23. BIN ...es/maprotation/expected_lines-parallel-label+45/{ → v1}/expected_lines-parallel-label+45_mask.png
  24. BIN ...ntrol_images/maprotation/expected_lines-parallel-label+45/v2/expected_lines-parallel-label+45.png
  25. BIN ...tdata/control_images/qgis_server/WMS_GetMap_LabelingSettings/WMS_GetMap_LabelingSettings_mask.png
@@ -25,7 +25,7 @@
#include <qgsvectorlayerdiagramprovider.h>
#include <qgsvectorlayerlabeling.h>
#include <qgsvectorlayerlabelprovider.h>
#include "qgsrenderchecker.h"
#include "qgsmultirenderchecker.h"
#include "qgsfontutils.h"
#include "qgsnullsymbolrenderer.h"
#include "pointset.h"
@@ -770,7 +770,7 @@ bool TestQgsLabelingEngine::imageCheck( const QString &testName, QImage &image,
{
//draw background
QImage imageWithBackground( image.width(), image.height(), QImage::Format_RGB32 );
QgsRenderChecker::drawBackground( &imageWithBackground );
QgsMultiRenderChecker::drawBackground( &imageWithBackground );
QPainter painter( &imageWithBackground );
painter.drawImage( 0, 0, image );
painter.end();
@@ -779,12 +779,12 @@ bool TestQgsLabelingEngine::imageCheck( const QString &testName, QImage &image,
QString tempDir = QDir::tempPath() + '/';
QString fileName = tempDir + testName + ".png";
imageWithBackground.save( fileName, "PNG" );
QgsRenderChecker checker;
QgsMultiRenderChecker checker;
checker.setControlPathPrefix( QStringLiteral( "labelingengine" ) );
checker.setControlName( "expected_" + testName );
checker.setRenderedImage( fileName );
checker.setColorTolerance( 2 );
bool resultFlag = checker.compareImages( testName, mismatchCount );
bool resultFlag = checker.runTest( testName, mismatchCount );
mReport += checker.report();
return resultFlag;
}
@@ -2173,7 +2173,7 @@ void TestQgsLabelingEngine::curvedOverrun()
QImage img = job.renderedImage();
QVERIFY( imageCheck( QStringLiteral( "label_curved_no_overrun" ), img, 20 ) );

settings.overrunDistance = 10;
settings.overrunDistance = 11;
vl2->setLabeling( new QgsVectorLayerSimpleLabeling( settings ) ); // TODO: this should not be necessary!
vl2->setLabelsEnabled( true );
QgsMapRendererSequentialJob job2( mapSettings );
@@ -45,7 +45,7 @@
#include "qgssinglesymbolrenderer.h"

//qgs unit test utility class
#include "qgsrenderchecker.h"
#include "qgsmultirenderchecker.h"

/**
* \ingroup UnitTests
@@ -32,7 +32,7 @@
#include "qgsvectorlayerlabeling.h"

//qgis unit test includes
#include <qgsrenderchecker.h>
#include "qgsmultirenderchecker.h"

/**
* \ingroup UnitTests
@@ -222,7 +222,7 @@ bool TestQgsMapRotation::render( const QString &testType )
{
mReport += "<h2>" + testType + "</h2>\n";
mMapSettings->setOutputDpi( 96 );
QgsRenderChecker checker;
QgsMultiRenderChecker checker;
checker.setControlPathPrefix( QStringLiteral( "maprotation" ) );
checker.setControlName( "expected_" + testType );
checker.setMapSettings( *mMapSettings );
@@ -553,7 +553,7 @@ def test_wms_getmap_transparent(self):
self._img_diff_error(r, h, "WMS_GetMap_Transparent")

def test_wms_getmap_labeling_settings(self):
# Test the `DrawRectOnly` option with 1 candidate (`CandidatesPolygon`).
# Test the `DrawRectOnly` option
# May fail if the labeling position engine is tweaked.

d = unitTestDataPath('qgis_server_accesscontrol') + '/'
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 322eb31

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