Skip to content
Permalink
Browse files

Fix failing pal labeling canvas test

Make sure image dpi respects mapsettings dpi in
QgsMapRendererSequentialJob.

Also apply a workaround to avoid segfault on end of test. This
workaround probably should be moved to QgsApplication::exitQgis()
but I'll do that after release in case of regressions.
  • Loading branch information
nyalldawson committed Feb 12, 2015
1 parent 5273889 commit e96b204b09f71d3fd6812fb2ac3aab44335419d6
Showing with 7 additions and 2 deletions.
  1. +1 −1 .travis.yml
  2. +2 −0 src/core/qgsmaprenderersequentialjob.cpp
  3. +4 −1 tests/src/python/test_qgspallabeling_canvas.py
@@ -25,5 +25,5 @@ install:
- cmake -DWITH_SERVER=ON -DWITH_STAGED_PLUGINS=OFF -DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON -DENABLE_MODELTEST=ON -DWITH_QWTPOLAR=OFF -DWITH_APIDOC=ON ..

script: xvfb-run ctest -V -E 'PyQgsPalLabelingCanvas|PyQgsPalLabelingServer|qgis_wcsprovidertest' -S ../qgis-test-travis.ctest --output-on-failure
script: xvfb-run ctest -V -E 'PyQgsPalLabelingServer|qgis_wcsprovidertest' -S ../qgis-test-travis.ctest --output-on-failure

@@ -29,6 +29,8 @@ QgsMapRendererSequentialJob::QgsMapRendererSequentialJob( const QgsMapSettings&
QgsDebugMsg( "SEQUENTIAL construct" );

mImage = QImage( mSettings.outputSize(), mSettings.outputImageFormat() );
mImage.setDotsPerMeterX( 1000 * settings.outputDpi() / 25.4 );
mImage.setDotsPerMeterY( 1000 * settings.outputDpi() / 25.4 );
}

QgsMapRendererSequentialJob::~QgsMapRendererSequentialJob()
@@ -17,9 +17,10 @@
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

import qgis
import sys
import os
from PyQt4.QtCore import qDebug
from PyQt4.QtCore import qDebug, QThreadPool

from utilities import (
getTempfilePath,
@@ -49,6 +50,8 @@ def tearDownClass(cls):
TestQgsPalLabeling.tearDownClass()
cls.removeMapLayer(cls.layer)
cls.layer = None
#avoid crash on finish, probably related to https://bugreports.qt.io/browse/QTBUG-35760
QThreadPool.globalInstance().waitForDone()

def setUp(self):
"""Run before each test."""

2 comments on commit e96b204

@strk

This comment has been minimized.

Copy link
Contributor

@strk strk replied Feb 13, 2015

Thank you for this. We are closer to a 100% success on make check :)

@nyalldawson

This comment has been minimized.

Copy link
Collaborator Author

@nyalldawson nyalldawson replied Feb 13, 2015

@strk - on ubuntu at least. See #1899 for my plans on making tests more portable -- I'd appreciate any feedback!

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