34
34
#include < qgsmaplayerregistry.h>
35
35
#include < qgsapplication.h>
36
36
#include < qgsmaprenderer.h>
37
+ #include < qgsmaplayerregistry.h>
37
38
38
39
// qgis unit test includes
39
40
#include < qgsrenderchecker.h>
@@ -57,6 +58,7 @@ class TestQgsRasterLayer: public QObject
57
58
void landsatBasic875Qml ();
58
59
void checkDimensions ();
59
60
void buildExternalOverviews ();
61
+ void registry ();
60
62
private:
61
63
bool render ( QString theFileName );
62
64
bool setQml ( QString theType );
@@ -204,6 +206,28 @@ void TestQgsRasterLayer::buildExternalOverviews()
204
206
// cleanup
205
207
delete mypLayer;
206
208
}
209
+
210
+
211
+ void TestQgsRasterLayer::registry ()
212
+ {
213
+ QString myTempPath = QDir::tempPath () + QDir::separator ();
214
+ QFile::remove ( myTempPath + " landsat.tif.ovr" );
215
+ QFile::copy ( mTestDataDir + " landsat.tif" , myTempPath + " landsat.tif" );
216
+ QFileInfo myRasterFileInfo ( myTempPath + " landsat.tif" );
217
+ QgsRasterLayer * mypLayer = new QgsRasterLayer ( myRasterFileInfo.filePath (),
218
+ myRasterFileInfo.completeBaseName () );
219
+
220
+ QgsMapLayerRegistry::instance ()->addMapLayer (mypLayer,false );
221
+ QgsMapLayerRegistry::instance ()->removeMapLayer (mypLayer->getLayerID ());
222
+ // cleanup
223
+ delete mypLayer;
224
+ }
225
+
226
+ //
227
+ // Helper methods
228
+ //
229
+
230
+
207
231
bool TestQgsRasterLayer::render ( QString theTestType )
208
232
{
209
233
mReport += " <h2>" + theTestType + " </h2>\n " ;
0 commit comments