@@ -185,11 +185,13 @@ void TestQgsRasterLayer::buildExternalOverviews()
185
185
// and make a copy of the landsat raster into the temp dir
186
186
QString myTempPath = QDir::tempPath () + QDir::separator ();
187
187
QFile::remove ( myTempPath + " landsat.tif.ovr" );
188
- QFile::copy ( mTestDataDir + " landsat.tif" , myTempPath + " landsat.tif" );
188
+ QFile::remove ( myTempPath + " landsat.tif" );
189
+ QVERIFY ( QFile::copy ( mTestDataDir + " landsat.tif" , myTempPath + " landsat.tif" ) );
189
190
QFileInfo myRasterFileInfo ( myTempPath + " landsat.tif" );
190
191
QgsRasterLayer * mypLayer = new QgsRasterLayer ( myRasterFileInfo.filePath (),
191
192
myRasterFileInfo.completeBaseName () );
192
193
194
+ QVERIFY ( mypLayer->isValid () );
193
195
194
196
//
195
197
// Ok now we can go on to test
@@ -234,17 +236,17 @@ void TestQgsRasterLayer::registry()
234
236
{
235
237
QString myTempPath = QDir::tempPath () + QDir::separator ();
236
238
QFile::remove ( myTempPath + " landsat.tif.ovr" );
237
- QFile::copy ( mTestDataDir + " landsat.tif" , myTempPath + " landsat.tif" );
239
+ QFile::remove ( myTempPath + " landsat.tif" );
240
+ QVERIFY ( QFile::copy ( mTestDataDir + " landsat.tif" , myTempPath + " landsat.tif" ) );
238
241
QFileInfo myRasterFileInfo ( myTempPath + " landsat.tif" );
239
242
QgsRasterLayer * mypLayer = new QgsRasterLayer ( myRasterFileInfo.filePath (),
240
243
myRasterFileInfo.completeBaseName () );
244
+ QVERIFY ( mypLayer->isValid () );
241
245
242
246
QgsMapLayerRegistry::instance ()->addMapLayers (
243
247
QList<QgsMapLayer *>() << mypLayer, false );
244
248
QgsMapLayerRegistry::instance ()->removeMapLayers (
245
249
QStringList () << mypLayer->id () );
246
- // cleanup
247
- // delete mypLayer;
248
250
}
249
251
250
252
//
@@ -285,4 +287,3 @@ bool TestQgsRasterLayer::setQml( QString theType )
285
287
286
288
QTEST_MAIN ( TestQgsRasterLayer )
287
289
#include " moc_testqgsrasterlayer.cxx"
288
-
0 commit comments