fix regression992 test

This commit is contained in:
Juergen E. Fischer 2014-03-31 23:07:05 +02:00
parent 1c27ee3198
commit 4619246f54

View File

@ -54,7 +54,6 @@ class Regression992: public QObject
bool render( QString theFileName ); bool render( QString theFileName );
QString mTestDataDir; QString mTestDataDir;
QgsRasterLayer *mpRasterLayer; QgsRasterLayer *mpRasterLayer;
QgsMapSettings mMapSettings;
QString mReport; QString mReport;
}; };
@ -63,10 +62,10 @@ void Regression992::initTestCase()
{ {
// init QGIS's paths - true means that all path will be inited from prefix // init QGIS's paths - true means that all path will be inited from prefix
QgsApplication::init(); QgsApplication::init();
QgsApplication::initQgis();
QgsApplication::showSettings(); QgsApplication::showSettings();
// QgsApplication::skipGdalDriver( "JP2ECW" ); // QgsApplication::skipGdalDriver( "JP2ECW" );
// QgsApplication::skipGdalDriver( "JP2MrSID" ); // QgsApplication::skipGdalDriver( "JP2MrSID" );
QgsApplication::initQgis();
//create some objects that will be used in all tests... //create some objects that will be used in all tests...
//create a raster layer that will be used in all tests... //create a raster layer that will be used in all tests...
@ -89,7 +88,6 @@ void Regression992::initTestCase()
myList << mpRasterLayer; myList << mpRasterLayer;
QgsMapLayerRegistry::instance()->addMapLayers( myList ); QgsMapLayerRegistry::instance()->addMapLayers( myList );
// add the test layer to the maprender // add the test layer to the maprender
mMapSettings.setLayers( QStringList() << mpRasterLayer->id() );
mReport += "<h1>Regression 992 Test</h1>\n"; mReport += "<h1>Regression 992 Test</h1>\n";
mReport += "<p>See <a href=\"http://hub.qgis.org/issues/992\">" mReport += "<p>See <a href=\"http://hub.qgis.org/issues/992\">"
"redmine ticket 992</a> for more details.</p>"; "redmine ticket 992</a> for more details.</p>";
@ -114,6 +112,7 @@ void Regression992::regression992()
{ {
QgsMapSettings settings; QgsMapSettings settings;
settings.setExtent( mpRasterLayer->extent() ); settings.setExtent( mpRasterLayer->extent() );
settings.setLayers( QStringList() << mpRasterLayer->id() );
QgsRenderChecker myChecker; QgsRenderChecker myChecker;
myChecker.setMapSettings( settings ); myChecker.setMapSettings( settings );
myChecker.setControlName( "expected_rgbwcmyk01_YeGeo.jp2" ); myChecker.setControlName( "expected_rgbwcmyk01_YeGeo.jp2" );