Skip to content

Commit d429f19

Browse files
committedJul 1, 2015
Some fixes to the tests on windows:
* defer initialization of map settings until after QgsApplication is initialized * disable local server test * set ogr encoding in qgsserver testproject.qgs
1 parent b847a06 commit d429f19

12 files changed

+127
-61
lines changed
 

‎src/server/qgshttprequesthandler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void QgsHttpRequestHandler::addToResponseHeader( const char * response )
112112
}
113113
else
114114
{
115-
printf( response );
115+
fputs( response, FCGI_stdout );
116116
}
117117
}
118118

@@ -124,7 +124,7 @@ void QgsHttpRequestHandler::addToResponseBody( const char * response )
124124
}
125125
else
126126
{
127-
printf( response );
127+
fputs( response, FCGI_stdout );
128128
}
129129
}
130130

@@ -219,7 +219,7 @@ QByteArray QgsHttpRequestHandler::getResponse( const bool returnHeaders,
219219
{
220220
if ( ! returnHeaders )
221221
{
222-
return mResponseBody;
222+
return mResponseBody;
223223
}
224224
else if ( ! returnBody )
225225
{

‎tests/src/core/testqgsatlascomposition.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class TestQgsAtlasComposition : public QObject
4949
, mAtlas( 0 )
5050
{}
5151

52+
~TestQgsAtlasComposition();
53+
5254
private slots:
5355
void initTestCase();// will be called before the first testfunction is executed.
5456
void cleanupTestCase();// will be called after the last testfunction was executed.
@@ -87,7 +89,7 @@ class TestQgsAtlasComposition : public QObject
8789
QgsComposerMap* mAtlasMap;
8890
QgsComposerMap* mOverview;
8991
//QgsMapRenderer* mMapRenderer;
90-
QgsMapSettings mMapSettings;
92+
QgsMapSettings *mMapSettings;
9193
QgsVectorLayer* mVectorLayer;
9294
QgsVectorLayer* mVectorLayer2;
9395
QgsAtlasComposition* mAtlas;
@@ -99,6 +101,8 @@ void TestQgsAtlasComposition::initTestCase()
99101
QgsApplication::init();
100102
QgsApplication::initQgis();
101103

104+
mMapSettings = new QgsMapSettings();
105+
102106
//create maplayers from testdata and add to layer registry
103107
QFileInfo vectorFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "france_parts.shp" );
104108
mVectorLayer = new QgsVectorLayer( vectorFileInfo.filePath(),
@@ -117,6 +121,12 @@ void TestQgsAtlasComposition::initTestCase()
117121
mReport = "<h1>Composer Atlas Tests</h1>\n";
118122
}
119123

124+
TestQgsAtlasComposition::~TestQgsAtlasComposition()
125+
{
126+
delete mMapSettings;
127+
}
128+
129+
120130
void TestQgsAtlasComposition::cleanupTestCase()
121131
{
122132
delete mComposition;
@@ -135,15 +145,15 @@ void TestQgsAtlasComposition::cleanupTestCase()
135145
void TestQgsAtlasComposition::init()
136146
{
137147
//create composition with composer map
138-
mMapSettings.setLayers( QStringList() << mVectorLayer->id() );
139-
mMapSettings.setCrsTransformEnabled( true );
140-
mMapSettings.setMapUnits( QGis::Meters );
148+
mMapSettings->setLayers( QStringList() << mVectorLayer->id() );
149+
mMapSettings->setCrsTransformEnabled( true );
150+
mMapSettings->setMapUnits( QGis::Meters );
141151

142152
// select epsg:2154
143153
QgsCoordinateReferenceSystem crs;
144154
crs.createFromSrid( 2154 );
145-
mMapSettings.setDestinationCrs( crs );
146-
mComposition = new QgsComposition( mMapSettings );
155+
mMapSettings->setDestinationCrs( crs );
156+
mComposition = new QgsComposition( *mMapSettings );
147157
mComposition->setPaperSize( 297, 210 ); //A4 landscape
148158

149159
// fix the renderer, fill with green

‎tests/src/core/testqgscomposermapgrid.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class TestQgsComposerMapGrid : public QObject
3232

3333
public:
3434
TestQgsComposerMapGrid();
35+
~TestQgsComposerMapGrid();
3536

3637
private slots:
3738
void initTestCase();// will be called before the first testfunction is executed.
@@ -61,22 +62,27 @@ class TestQgsComposerMapGrid : public QObject
6162
private:
6263
QgsComposition* mComposition;
6364
QgsComposerMap* mComposerMap;
64-
QgsMapSettings mMapSettings;
65+
QgsMapSettings *mMapSettings;
6566
QString mReport;
6667
};
6768

6869
TestQgsComposerMapGrid::TestQgsComposerMapGrid()
6970
: mComposition( NULL )
7071
, mComposerMap( NULL )
7172
{
73+
QgsApplication::init();
74+
QgsApplication::initQgis();
7275

76+
mMapSettings = new QgsMapSettings();
7377
}
7478

75-
void TestQgsComposerMapGrid::initTestCase()
79+
TestQgsComposerMapGrid::~TestQgsComposerMapGrid()
7680
{
77-
QgsApplication::init();
78-
QgsApplication::initQgis();
81+
delete mMapSettings;
82+
}
7983

84+
void TestQgsComposerMapGrid::initTestCase()
85+
{
8086
mReport = "<h1>Composer Map Grid Tests</h1>\n";
8187
}
8288

@@ -97,9 +103,9 @@ void TestQgsComposerMapGrid::cleanupTestCase()
97103
void TestQgsComposerMapGrid::init()
98104
{
99105
QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem( 32633 );
100-
mMapSettings.setDestinationCrs( crs );
101-
mMapSettings.setCrsTransformEnabled( false );
102-
mComposition = new QgsComposition( mMapSettings );
106+
mMapSettings->setDestinationCrs( crs );
107+
mMapSettings->setCrsTransformEnabled( false );
108+
mComposition = new QgsComposition( *mMapSettings );
103109
mComposition->setPaperSize( 297, 210 ); //A4 landscape
104110
mComposerMap = new QgsComposerMap( mComposition, 20, 20, 200, 100 );
105111
mComposerMap->setFrameEnabled( true );
@@ -162,7 +168,7 @@ void TestQgsComposerMapGrid::reprojected()
162168

163169
bool testResult = checker.testComposition( mReport, 0, 0 );
164170
mComposerMap->grid()->setEnabled( false );
165-
mComposerMap->grid()->setCrs( mMapSettings.destinationCrs() );
171+
mComposerMap->grid()->setCrs( mMapSettings->destinationCrs() );
166172
mComposerMap->grid()->setFrameStyle( QgsComposerMapGrid::NoFrame );
167173
mComposerMap->setFrameEnabled( true );
168174
QVERIFY( testResult );

‎tests/src/core/testqgscomposerpicture.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class TestQgsComposerPicture : public QObject
3030

3131
public:
3232
TestQgsComposerPicture();
33+
~TestQgsComposerPicture();
3334

3435
private slots:
3536
void initTestCase();// will be called before the first testfunction is executed.
@@ -64,7 +65,7 @@ class TestQgsComposerPicture : public QObject
6465
private:
6566
QgsComposition* mComposition;
6667
QgsComposerPicture* mComposerPicture;
67-
QgsMapSettings mMapSettings;
68+
QgsMapSettings *mMapSettings;
6869
QString mReport;
6970
QString mPngImage;
7071
QString mSvgImage;
@@ -77,15 +78,22 @@ TestQgsComposerPicture::TestQgsComposerPicture()
7778

7879
}
7980

81+
TestQgsComposerPicture::~TestQgsComposerPicture()
82+
{
83+
delete mMapSettings;
84+
}
85+
8086
void TestQgsComposerPicture::initTestCase()
8187
{
8288
QgsApplication::init();
8389
QgsApplication::initQgis();
8490

91+
mMapSettings = new QgsMapSettings();
92+
8593
mPngImage = QString( TEST_DATA_DIR ) + QDir::separator() + "sample_image.png";
8694
mSvgImage = QString( TEST_DATA_DIR ) + QDir::separator() + "sample_svg.svg";
8795

88-
mComposition = new QgsComposition( mMapSettings );
96+
mComposition = new QgsComposition( *mMapSettings );
8997
mComposition->setPaperSize( 297, 210 ); //A4 landscape
9098

9199
mComposerPicture = new QgsComposerPicture( mComposition );

‎tests/src/core/testqgscomposerrotation.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ class TestQgsComposerRotation : public QObject
4141
, mComposerRect( 0 )
4242
, mComposerLabel( 0 )
4343
, mRasterLayer( 0 )
44+
, mMapSettings( 0 )
4445
{}
4546

47+
~TestQgsComposerRotation();
48+
4649
private slots:
4750
void initTestCase();// will be called before the first testfunction is executed.
4851
void cleanupTestCase();// will be called after the last testfunction was executed.
@@ -63,16 +66,23 @@ class TestQgsComposerRotation : public QObject
6366
QgsComposition* mComposition;
6467
QgsComposerShape* mComposerRect;
6568
QgsComposerLabel* mComposerLabel;
66-
QgsMapSettings mMapSettings;
69+
QgsMapSettings *mMapSettings;
6770
QgsRasterLayer* mRasterLayer;
6871
QString mReport;
6972
};
7073

74+
TestQgsComposerRotation::~TestQgsComposerRotation()
75+
{
76+
delete mMapSettings;
77+
}
78+
7179
void TestQgsComposerRotation::initTestCase()
7280
{
7381
QgsApplication::init();
7482
QgsApplication::initQgis();
7583

84+
mMapSettings = new QgsMapSettings();
85+
7686
//create maplayers from testdata and add to layer registry
7787
QFileInfo rasterFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "rgb256x256.png" );
7888
mRasterLayer = new QgsRasterLayer( rasterFileInfo.filePath(),
@@ -82,10 +92,10 @@ void TestQgsComposerRotation::initTestCase()
8292

8393
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << mRasterLayer );
8494

85-
mMapSettings.setLayers( QStringList() << mRasterLayer->id() );
86-
mMapSettings.setCrsTransformEnabled( false );
95+
mMapSettings->setLayers( QStringList() << mRasterLayer->id() );
96+
mMapSettings->setCrsTransformEnabled( false );
8797

88-
mComposition = new QgsComposition( mMapSettings );
98+
mComposition = new QgsComposition( *mMapSettings );
8999
mComposition->setPaperSize( 297, 210 ); //A4 landscape
90100

91101
mComposerRect = new QgsComposerShape( 70, 70, 150, 100, mComposition );

‎tests/src/core/testqgscomposerscalebar.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,14 @@ class TestQgsComposerScaleBar : public QObject
3838
, mComposerMap( 0 )
3939
, mComposerScaleBar( 0 )
4040
, mRasterLayer( 0 )
41+
, mMapSettings( 0 )
4142
{}
4243

44+
~TestQgsComposerScaleBar()
45+
{
46+
delete mMapSettings;
47+
}
48+
4349
private slots:
4450
void initTestCase();// will be called before the first testfunction is executed.
4551
void cleanupTestCase();// will be called after the last testfunction was executed.
@@ -56,7 +62,7 @@ class TestQgsComposerScaleBar : public QObject
5662
QgsComposerMap* mComposerMap;
5763
QgsComposerScaleBar* mComposerScaleBar;
5864
QgsRasterLayer* mRasterLayer;
59-
QgsMapSettings mMapSettings;
65+
QgsMapSettings *mMapSettings;
6066
QString mReport;
6167
};
6268

@@ -65,6 +71,8 @@ void TestQgsComposerScaleBar::initTestCase()
6571
QgsApplication::init();
6672
QgsApplication::initQgis();
6773

74+
mMapSettings = new QgsMapSettings();
75+
6876
//create maplayers from testdata and add to layer registry
6977
QFileInfo rasterFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "landsat.tif" );
7078
mRasterLayer = new QgsRasterLayer( rasterFileInfo.filePath(),
@@ -75,15 +83,15 @@ void TestQgsComposerScaleBar::initTestCase()
7583
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << mRasterLayer );
7684

7785
//create composition with composer map
78-
mMapSettings.setLayers( QStringList() << mRasterLayer->id() );
86+
mMapSettings->setLayers( QStringList() << mRasterLayer->id() );
7987

8088
//reproject to WGS84
8189
QgsCoordinateReferenceSystem destCRS;
8290
destCRS.createFromId( 4326, QgsCoordinateReferenceSystem::EpsgCrsId );
83-
mMapSettings.setDestinationCrs( destCRS );
84-
mMapSettings.setCrsTransformEnabled( true );
91+
mMapSettings->setDestinationCrs( destCRS );
92+
mMapSettings->setCrsTransformEnabled( true );
8593

86-
mComposition = new QgsComposition( mMapSettings );
94+
mComposition = new QgsComposition( *mMapSettings );
8795
mComposition->setPaperSize( 297, 210 ); //A4 landscape
8896
mComposerMap = new QgsComposerMap( mComposition, 20, 20, 150, 150 );
8997
mComposerMap->setFrameEnabled( true );

‎tests/src/core/testqgscomposertablev2.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class TestQgsComposerTableV2 : public QObject
7171

7272
private:
7373
QgsComposition* mComposition;
74-
QgsMapSettings mMapSettings;
74+
QgsMapSettings *mMapSettings;
7575
QgsVectorLayer* mVectorLayer;
7676
QgsComposerAttributeTableV2* mComposerAttributeTable;
7777
QgsComposerFrame* mFrame1;
@@ -87,15 +87,17 @@ void TestQgsComposerTableV2::initTestCase()
8787
QgsApplication::init();
8888
QgsApplication::initQgis();
8989

90+
mMapSettings = new QgsMapSettings();
91+
9092
//create maplayers from testdata and add to layer registry
9193
QFileInfo vectorFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "points.shp" );
9294
mVectorLayer = new QgsVectorLayer( vectorFileInfo.filePath(),
9395
vectorFileInfo.completeBaseName(),
9496
"ogr" );
9597
QgsMapLayerRegistry::instance()->addMapLayer( mVectorLayer );
9698

97-
mMapSettings.setLayers( QStringList() << mVectorLayer->id() );
98-
mMapSettings.setCrsTransformEnabled( false );
99+
mMapSettings->setLayers( QStringList() << mVectorLayer->id() );
100+
mMapSettings->setCrsTransformEnabled( false );
99101

100102
mReport = "<h1>Composer TableV2 Tests</h1>\n";
101103
}
@@ -116,7 +118,7 @@ void TestQgsComposerTableV2::cleanupTestCase()
116118
void TestQgsComposerTableV2::init()
117119
{
118120
//create composition with composer map
119-
mComposition = new QgsComposition( mMapSettings );
121+
mComposition = new QgsComposition( *mMapSettings );
120122
mComposition->setPaperSize( 297, 210 ); //A4 portrait
121123

122124
mComposerAttributeTable = new QgsComposerAttributeTableV2( mComposition, false );

‎tests/src/core/testqgscomposerutils.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class TestQgsComposerUtils : public QObject
3030
Q_OBJECT
3131
public:
3232
TestQgsComposerUtils();
33+
~TestQgsComposerUtils();
3334

3435
private slots:
3536
void initTestCase();// will be called before the first testfunction is executed.
@@ -63,7 +64,7 @@ class TestQgsComposerUtils : public QObject
6364
private:
6465
bool renderCheck( QString testName, QImage &image, int mismatchCount = 0 );
6566
QgsComposition* mComposition;
66-
QgsMapSettings mMapSettings;
67+
QgsMapSettings *mMapSettings;
6768
QString mReport;
6869
QFont mTestFont;
6970

@@ -72,15 +73,20 @@ class TestQgsComposerUtils : public QObject
7273
TestQgsComposerUtils::TestQgsComposerUtils()
7374
: mComposition( NULL )
7475
{
76+
QgsApplication::init();
77+
QgsApplication::initQgis(); //for access to test font
7578

79+
mMapSettings = new QgsMapSettings();
7680
}
7781

78-
void TestQgsComposerUtils::initTestCase()
82+
TestQgsComposerUtils::~TestQgsComposerUtils()
7983
{
80-
QgsApplication::init();
81-
QgsApplication::initQgis(); //for access to test font
84+
delete mMapSettings;
85+
}
8286

83-
mComposition = new QgsComposition( mMapSettings );
87+
void TestQgsComposerUtils::initTestCase()
88+
{
89+
mComposition = new QgsComposition( *mMapSettings );
8490
mComposition->setPaperSize( 297, 210 ); //A4 landscape
8591

8692
mReport = "<h1>Composer Utils Tests</h1>\n";

‎tests/src/core/testqgsmaprotation.cpp

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class TestQgsMapRotation : public QObject
4646
mTestDataDir = QString( TEST_DATA_DIR ) + QDir::separator();
4747
}
4848

49+
~TestQgsMapRotation();
50+
4951
private slots:
5052
void initTestCase();// will be called before the first testfunction is executed.
5153
void cleanupTestCase();// will be called after the last testfunction was executed.
@@ -64,7 +66,7 @@ class TestQgsMapRotation : public QObject
6466
QgsRasterLayer * mRasterLayer;
6567
QgsMapLayer * mPointsLayer;
6668
QgsMapLayer * mLinesLayer;
67-
QgsMapSettings mMapSettings;
69+
QgsMapSettings *mMapSettings;
6870
QString mReport;
6971
};
7072

@@ -75,6 +77,8 @@ void TestQgsMapRotation::initTestCase()
7577
QgsApplication::init();
7678
QgsApplication::initQgis();
7779

80+
mMapSettings = new QgsMapSettings();
81+
7882
QList<QgsMapLayer *> mapLayers;
7983

8084
//create a raster layer that will be used in all tests...
@@ -105,11 +109,16 @@ void TestQgsMapRotation::initTestCase()
105109
// This is needed to correctly set rotation center,
106110
// the actual size doesn't matter as QgsRenderChecker will
107111
// re-set it to the size of the expected image
108-
mMapSettings.setOutputSize( QSize( 256, 256 ) );
112+
mMapSettings->setOutputSize( QSize( 256, 256 ) );
109113

110114
mReport += "<h1>Map Rotation Tests</h1>\n";
111115
}
112116

117+
TestQgsMapRotation::~TestQgsMapRotation()
118+
{
119+
delete mMapSettings;
120+
}
121+
113122
//runs after all tests
114123
void TestQgsMapRotation::cleanupTestCase()
115124
{
@@ -129,37 +138,37 @@ void TestQgsMapRotation::cleanupTestCase()
129138

130139
void TestQgsMapRotation::rasterLayer()
131140
{
132-
mMapSettings.setLayers( QStringList() << mRasterLayer->id() );
133-
mMapSettings.setExtent( mRasterLayer->extent() );
134-
mMapSettings.setRotation( 45 );
141+
mMapSettings->setLayers( QStringList() << mRasterLayer->id() );
142+
mMapSettings->setExtent( mRasterLayer->extent() );
143+
mMapSettings->setRotation( 45 );
135144
// This ensures rotated image is all visible by tweaking scale
136-
mMapSettings.setExtent( mMapSettings.visibleExtent() );
145+
mMapSettings->setExtent( mMapSettings->visibleExtent() );
137146
QVERIFY( render( "raster+45" ) );
138147

139-
mMapSettings.setRotation( -45 );
148+
mMapSettings->setRotation( -45 );
140149
QVERIFY( render( "raster-45" ) );
141150
}
142151

143152
void TestQgsMapRotation::pointsLayer()
144153
{
145-
mMapSettings.setLayers( QStringList() << mPointsLayer->id() );
154+
mMapSettings->setLayers( QStringList() << mPointsLayer->id() );
146155

147156
// SVG points, fixed (no) rotation
148157
QString qml = mTestDataDir + "points.qml";
149158
bool success = false;
150159
mPointsLayer->loadNamedStyle( qml, success );
151160
QVERIFY( success );
152-
mMapSettings.setExtent( QgsRectangle( -105.5, 37, -97.5, 45 ) );
153-
mMapSettings.setRotation( -60 );
161+
mMapSettings->setExtent( QgsRectangle( -105.5, 37, -97.5, 45 ) );
162+
mMapSettings->setRotation( -60 );
154163
QVERIFY( render( "svgpoints-60" ) );
155164

156165
// SVG points, data defined rotation
157166
qml = mTestDataDir + "points_single_symbol_datadefined_rotation.qml";
158167
success = false;
159168
mPointsLayer->loadNamedStyle( qml, success );
160169
QVERIFY( success );
161-
mMapSettings.setExtent( QgsRectangle( -116, 33, -107, 42 ) );
162-
mMapSettings.setRotation( 90 );
170+
mMapSettings->setExtent( QgsRectangle( -116, 33, -107, 42 ) );
171+
mMapSettings->setRotation( 90 );
163172
QVERIFY( render( "svgpoints-datadefined+90" ) );
164173

165174
// TODO: SVG points, fixed (defined) rotation ?
@@ -169,33 +178,33 @@ void TestQgsMapRotation::pointsLayer()
169178
success = false;
170179
mPointsLayer->loadNamedStyle( qml, success );
171180
QVERIFY( success );
172-
mMapSettings.setExtent( QgsRectangle( -116, 33, -107, 42 ) );
173-
mMapSettings.setRotation( 90 );
181+
mMapSettings->setExtent( QgsRectangle( -116, 33, -107, 42 ) );
182+
mMapSettings->setRotation( 90 );
174183
QVERIFY( render( "simplepoints-datadefined+90" ) );
175184

176185
// Simple points, fixed (no) rotation
177186
qml = mTestDataDir + "points_graduated_symbol.qml";
178187
success = false;
179188
mPointsLayer->loadNamedStyle( qml, success );
180189
QVERIFY( success );
181-
mMapSettings.setExtent( QgsRectangle( -108, 26, -100, 34 ) );
182-
mMapSettings.setRotation( 30 );
190+
mMapSettings->setExtent( QgsRectangle( -108, 26, -100, 34 ) );
191+
mMapSettings->setRotation( 30 );
183192
QVERIFY( render( "simplepoints+30" ) );
184193

185194
// TODO: simple points, fixed (defined) rotation ?
186195
}
187196

188197
void TestQgsMapRotation::linesLayer()
189198
{
190-
mMapSettings.setLayers( QStringList() << mLinesLayer->id() );
199+
mMapSettings->setLayers( QStringList() << mLinesLayer->id() );
191200

192201
// Arrowed line with parallel labels
193202
QString qml = mTestDataDir + "lines_cardinals_arrowed_parallel_label.qml";
194203
bool success = false;
195204
mLinesLayer->loadNamedStyle( qml, success );
196205
QVERIFY( success );
197-
mMapSettings.setExtent( mLinesLayer->extent() ); //QgsRectangle(-150,-150,150,150) );
198-
mMapSettings.setRotation( 45 );
206+
mMapSettings->setExtent( mLinesLayer->extent() ); //QgsRectangle(-150,-150,150,150) );
207+
mMapSettings->setRotation( 45 );
199208
QVERIFY( render( "lines-parallel-label+45" ) );
200209

201210
// TODO: horizontal labels
@@ -205,11 +214,11 @@ void TestQgsMapRotation::linesLayer()
205214
bool TestQgsMapRotation::render( QString theTestType )
206215
{
207216
mReport += "<h2>" + theTestType + "</h2>\n";
208-
mMapSettings.setOutputDpi( 96 );
217+
mMapSettings->setOutputDpi( 96 );
209218
QgsRenderChecker checker;
210219
checker.setControlPathPrefix( "maprotation" );
211220
checker.setControlName( "expected_" + theTestType );
212-
checker.setMapSettings( mMapSettings );
221+
checker.setMapSettings( *mMapSettings );
213222
bool result = checker.runTest( theTestType );
214223
mReport += "\n\n\n" + checker.report();
215224
return result;

‎tests/src/python/test_qgis_local_server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
import StringIO
2525
import tempfile
2626

27+
if os.name == 'nt':
28+
print "TestQgisLocalServer currently doesn't support windows"
29+
sys.exit(0)
30+
2731
from qgis.core import (
2832
QgsRectangle,
2933
QgsCoordinateReferenceSystem,

‎tests/src/python/test_qgsserver.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
import os
1616
import re
1717
import unittest
18+
import tempfile
1819
from qgis.server import QgsServer
1920
from qgis.core import QgsMessageLog
2021
from utilities import unitTestDataPath
2122

22-
# Strip path and content lenght because path may vary
23+
# Strip path and content length because path may vary
2324
RE_STRIP_PATH=r'MAP=[^&]+(&amp;)*|Content-Length: \d+'
2425

2526

@@ -108,7 +109,9 @@ def wms_request_compare(self, request):
108109
f = open(self.testdata_path + request.lower() + '.txt')
109110
expected = f.read()
110111
f.close()
111-
self.assertEqual(re.sub(RE_STRIP_PATH, '', response), re.sub(RE_STRIP_PATH, '', expected))
112+
response = re.sub(RE_STRIP_PATH, '', response)
113+
expected = re.sub(RE_STRIP_PATH, '', expected)
114+
self.assertEqual(response, expected, msg="request %s failed" % request)
112115

113116

114117
def test_project_wms(self):

‎tests/testdata/qgis_server/testproject.qgs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<geographicflag>true</geographicflag>
7070
</spatialrefsys>
7171
</srs>
72-
<provider encoding="System">ogr</provider>
72+
<provider encoding="UTF-8">ogr</provider>
7373
<previewExpression></previewExpression>
7474
<vectorjoins/>
7575
<expressionfields/>

0 commit comments

Comments
 (0)
Please sign in to comment.