Skip to content

Commit

Permalink
fix some tests crashes, fix some tests and some mtr updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 29, 2014
1 parent 480ae45 commit 0693fe9
Show file tree
Hide file tree
Showing 37 changed files with 166 additions and 231 deletions.
3 changes: 2 additions & 1 deletion debian/control.jessie
Expand Up @@ -37,7 +37,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.5
Homepage: http://qgis.org/
Expand Down
3 changes: 2 additions & 1 deletion debian/control.precise
Expand Up @@ -38,7 +38,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.quantal
Expand Up @@ -37,7 +37,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.3
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.raring
Expand Up @@ -39,7 +39,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.saucy
Expand Up @@ -39,7 +39,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.sid
Expand Up @@ -37,7 +37,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.5
Homepage: http://qgis.org/
Expand Down
3 changes: 2 additions & 1 deletion debian/control.sid-oracle
Expand Up @@ -38,7 +38,8 @@ Build-Depends:
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
oracle-instantclient11.2-devel
oracle-instantclient11.2-devel,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.5
Homepage: http://qgis.org/
Expand Down
3 changes: 2 additions & 1 deletion debian/control.trusty
Expand Up @@ -37,7 +37,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.wheezy
Expand Up @@ -37,7 +37,8 @@ Build-Depends:
graphviz,
txt2tags,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
spawn-cgi, lighttpd, poppler-utils
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.3
XS-Python-Version: current
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -143,7 +143,7 @@ build-stamp: debian/build/CMakeCache.txt

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Code to run the package test suite - and ignore the outcome for now
-LD_LIBRARY_PATH=$(PWD)/debian/build/output/lib:$(LD_LIBRARY_PATH) $(TESTMAKE) -C debian/build $(DEB_TEST_TARGET)
-LD_LIBRARY_PATH=$(PWD)/debian/build/output/lib:$(LD_LIBRARY_PATH) PATH=/usr/sbin:$(PATH) LC_CTYPE=C.UTF-8 $(TESTMAKE) -C debian/build $(DEB_TEST_TARGET)
else
@echo Skipping tests.
endif
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmaprenderercache.sip
Expand Up @@ -6,7 +6,7 @@
* the cache listens to repaintRequested() signals from layer. If triggered, the cache
* removes the rendered image (and disconnects from the layer).
*
* The class is thread-safe (multiple classes can access the same instance safely).
* The class is thread-safe (multiple classes can access the same instance safely).
*
* @note added in 2.4
*/
Expand Down
12 changes: 4 additions & 8 deletions src/app/qgisapp.cpp
Expand Up @@ -448,11 +448,11 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
, mMousePrecisionDecimalPlaces( 0 )
, mInternalClipboard( 0 )
, mShowProjectionTab( false )
, mPythonUtils( NULL )
, mPythonUtils( 0 )
#ifdef Q_OS_WIN
, mSkipNextContextMenuEvent( 0 )
#endif
, mpGpsWidget( NULL )
, mpGpsWidget( 0 )
{
if ( smInstance )
{
Expand Down Expand Up @@ -785,6 +785,7 @@ QgisApp::QgisApp( )
mMapCanvas->freeze();
mMapLegend = new QgsLegend( mMapCanvas );
mUndoWidget = new QgsUndoWidget( NULL, mMapCanvas );
mInfoBar = new QgsMessageBar( centralWidget() );
// More tests may need more members to be initialized
}

Expand Down Expand Up @@ -3785,12 +3786,7 @@ void QgisApp::dxfExport()
dxfExport.setSymbologyExport( d.symbologyMode() );
if ( mapCanvas() )
{
QgsMapRenderer* r = mapCanvas()->mapRenderer();
if ( r )
{
dxfExport.setMapUnits( r->mapUnits() );
}

dxfExport.setMapUnits( mapCanvas()->mapUnits() );
//extent
if ( d.exportMapExtent() )
{
Expand Down
44 changes: 22 additions & 22 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -42,17 +42,17 @@
#include <cmath>

QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
: QgsComposerItem( x, y, width, height, composition ), mMapRotation( 0 ), mKeepLayerSet( false ),
mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
mTopGridAnnotationPosition( OutsideMapFrame ), mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ),
mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ), mTopGridAnnotationDirection( Horizontal ),
mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ),
mGridFramePenThickness( 0.5 ), mGridFramePenColor( QColor( 0, 0, 0 ) ), mGridFrameFillColor1( Qt::white ), mGridFrameFillColor2( Qt::black ),
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ), mAtlasDriven( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 )
: QgsComposerItem( x, y, width, height, composition ), mMapRotation( 0 ), mKeepLayerSet( false )
, mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false )
, mGridEnabled( false ), mGridStyle( Solid )
, mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) )
, mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver )
, mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame )
, mTopGridAnnotationPosition( OutsideMapFrame ), mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 )
, mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ), mTopGridAnnotationDirection( Horizontal )
, mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 )
, mGridFramePenThickness( 0.5 ), mGridFramePenColor( QColor( 0, 0, 0 ) ), mGridFrameFillColor1( Qt::white ), mGridFrameFillColor2( Qt::black )
, mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ), mAtlasDriven( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 )
{
mComposition = composition;
mOverviewFrameMapSymbol = 0;
Expand Down Expand Up @@ -100,17 +100,17 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
}

QgsComposerMap::QgsComposerMap( QgsComposition *composition )
: QgsComposerItem( 0, 0, 10, 10, composition ), mMapRotation( 0 ), mKeepLayerSet( false ), mOverviewFrameMapId( -1 ),
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
mTopGridAnnotationPosition( OutsideMapFrame ), mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ),
mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ), mTopGridAnnotationDirection( Horizontal ),
mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ), mGridFramePenThickness( 0.5 ),
mGridFramePenColor( QColor( 0, 0, 0 ) ), mGridFrameFillColor1( Qt::white ), mGridFrameFillColor2( Qt::black ),
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ), mAtlasDriven( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 )
: QgsComposerItem( 0, 0, 10, 10, composition ), mMapRotation( 0 ), mKeepLayerSet( false ), mOverviewFrameMapId( -1 )
, mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false )
, mGridEnabled( false ), mGridStyle( Solid )
, mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) )
, mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver )
, mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame )
, mTopGridAnnotationPosition( OutsideMapFrame ), mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 )
, mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ), mTopGridAnnotationDirection( Horizontal )
, mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ), mGridFramePenThickness( 0.5 )
, mGridFramePenColor( QColor( 0, 0, 0 ) ), mGridFrameFillColor1( Qt::white ), mGridFrameFillColor2( Qt::black )
, mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ), mAtlasDriven( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 )
{
mOverviewFrameMapSymbol = 0;
mGridLineSymbol = 0;
Expand Down
16 changes: 10 additions & 6 deletions src/core/dxf/qgsdxfpallabeling.cpp
Expand Up @@ -19,21 +19,25 @@
#include "qgsdxfexport.h"
#include "qgsmaplayerregistry.h"
#include "qgspalgeometry.h"
#include "qgsmapsettings.h"

#include "pal/pointset.h"
#include "pal/labelposition.h"

using namespace pal;

QgsDxfPalLabeling::QgsDxfPalLabeling( QgsDxfExport* dxf, const QgsRectangle& bbox, double scale, QGis::UnitType mapUnits ): QgsPalLabeling(), mDxfExport( dxf )
QgsDxfPalLabeling::QgsDxfPalLabeling( QgsDxfExport* dxf, const QgsRectangle& bbox, double scale, QGis::UnitType mapUnits )
: QgsPalLabeling()
, mDxfExport( dxf )
{
mMapRenderer.setExtent( bbox );
QgsMapSettings settings;
settings.setExtent( bbox );

int dpi = 96;
double factor = 1000 * dpi / scale / 25.4 * QGis::fromUnitToUnitFactor( mapUnits, QGis::Meters );
mMapRenderer.setOutputSize( QSizeF( bbox.width() * factor, bbox.height() * factor ), dpi );
mMapRenderer.setScale( scale );
mMapRenderer.setOutputUnits( QgsMapRenderer::Pixels );
init( &mMapRenderer );
settings.setOutputSize( QSize( bbox.width() * factor, bbox.height() * factor ) );
settings.setOutputDpi( dpi );
init( settings );

mImage = new QImage( 10, 10, QImage::Format_ARGB32_Premultiplied );
mImage->setDotsPerMeterX( 96 / 25.4 * 1000 );
Expand Down
1 change: 0 additions & 1 deletion src/core/dxf/qgsdxfpallabeling.h
Expand Up @@ -35,7 +35,6 @@ class CORE_EXPORT QgsDxfPalLabeling: public QgsPalLabeling

private:
QgsDxfExport* mDxfExport;
QgsMapRenderer mMapRenderer;
QgsRenderContext mRenderContext;

//only used for render context
Expand Down
18 changes: 17 additions & 1 deletion src/core/qgsdiagramrendererv2.cpp
Expand Up @@ -18,9 +18,24 @@
#include "diagram/qgspiediagram.h"
#include "diagram/qgshistogramdiagram.h"
#include "qgsrendercontext.h"

#include <QDomElement>
#include <QPainter>

QgsDiagramLayerSettings::QgsDiagramLayerSettings()
: placement( AroundPoint )
, placementFlags( OnLine )
, priority( 5 )
, obstacle( false )
, dist( 0.0 )
, renderer( 0 )
, palLayer( 0 )
, ct( 0 )
, xform( 0 )
, xPosColumn( -1 )
, yPosColumn( -1 )
{
}

QgsDiagramLayerSettings::~QgsDiagramLayerSettings()
{
Expand Down Expand Up @@ -254,7 +269,8 @@ void QgsDiagramSettings::writeXML( QDomElement& rendererElem, QDomDocument& doc,
rendererElem.appendChild( categoryElem );
}

QgsDiagramRendererV2::QgsDiagramRendererV2(): mDiagram( 0 )
QgsDiagramRendererV2::QgsDiagramRendererV2()
: mDiagram( 0 )
{
}

Expand Down
15 changes: 1 addition & 14 deletions src/core/qgsdiagramrendererv2.h
Expand Up @@ -58,20 +58,7 @@ class CORE_EXPORT QgsDiagramLayerSettings
MapOrientation = 8
};

QgsDiagramLayerSettings()
: placement( AroundPoint )
, placementFlags( OnLine )
, priority( 5 )
, obstacle( false )
, dist( 0.0 )
, renderer( 0 )
, palLayer( 0 )
, ct( 0 )
, xform( 0 )
, xPosColumn( -1 )
, yPosColumn( -1 )
{
}
QgsDiagramLayerSettings();

~QgsDiagramLayerSettings();

Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsexpression.cpp
Expand Up @@ -2220,6 +2220,8 @@ int QgsExpression::NodeBinaryOperator::precedence() const
case boConcat:
return 7;
}
Q_ASSERT( 0 && "unexpected binary operator" );
return -1;
}

QString QgsExpression::NodeBinaryOperator::dump() const
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsfontutils.cpp
Expand Up @@ -241,8 +241,8 @@ bool QgsFontUtils::loadStandardTestFonts( QStringList loadstyles )
int fontID = QFontDatabase::addApplicationFont( fontPath );
loaded = ( fontID != -1 );
fontsLoaded = ( fontsLoaded || loaded );
QgsDebugMsg( QString( "Test font '%1' %2 from filesystem" )
.arg( familyStyle ).arg( loaded ? "loaded" : "FAILED to load" ) );
QgsDebugMsg( QString( "Test font '%1' %2 from filesystem [%3]" )
.arg( familyStyle ).arg( loaded ? "loaded" : "FAILED to load" ).arg( fontPath ) );
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsmaprendererjob.cpp
Expand Up @@ -649,14 +649,14 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
}
}

/*
#if 0
// TODO: split extent
if ( split )
{
mRenderContext.setExtent( r2 );
ml->draw( mRenderContext );
}*/

}
#endif
} // while (li.hasPrevious())

return layerJobs;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmapsettings.h
Expand Up @@ -61,7 +61,7 @@ class CORE_EXPORT QgsMapSettings
ForceVectorOutput = 0x04,
UseAdvancedEffects = 0x08,
DrawLabeling = 0x10
// TODO: ignore scale-based visibiity (overview)
// TODO: ignore scale-based visibility (overview)
};
Q_DECLARE_FLAGS( Flags, Flag )

Expand Down
2 changes: 0 additions & 2 deletions src/core/qgsrenderchecker.cpp
Expand Up @@ -30,7 +30,6 @@
QgsRenderChecker::QgsRenderChecker( ) :
mReport( "" ),
mMatchTarget( 0 ),
mpMapRenderer( NULL ),
mElapsedTime( 0 ),
mRenderedImageFile( "" ),
mExpectedImageFile( "" ),
Expand All @@ -39,7 +38,6 @@ QgsRenderChecker::QgsRenderChecker( ) :
mElapsedTimeTarget( 0 ),
mControlPathPrefix( "" )
{

}

QString QgsRenderChecker::controlImagePath() const
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsrenderchecker.h
Expand Up @@ -121,7 +121,6 @@ class CORE_EXPORT QgsRenderChecker

QString mReport;
unsigned int mMatchTarget;
QgsMapRenderer * mpMapRenderer;
int mElapsedTime;
QString mRenderedImageFile;
QString mExpectedImageFile;
Expand Down

0 comments on commit 0693fe9

Please sign in to comment.