Skip to content

Commit 8fda2b7

Browse files
committed
use temp copy of points.shp
1 parent 73e3ead commit 8fda2b7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/src/core/testqgsofflineediting.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class TestQgsOfflineEditing : public QObject
4141
QStringList layerIds;
4242
long numberOfFeatures;
4343
int numberOfFields;
44+
QTemporaryDir tempDir;
4445

4546
private slots:
4647
void initTestCase();// will be called before the first testfunction is executed.
@@ -75,8 +76,12 @@ void TestQgsOfflineEditing::cleanupTestCase()
7576
void TestQgsOfflineEditing::init()
7677
{
7778
QString myFileName( TEST_DATA_DIR ); //defined in CmakeLists.txt
78-
myFileName = myFileName + "/points.shp";
79-
QFileInfo myMapFileInfo( myFileName );
79+
QString myTempDirName = tempDir.path();
80+
QFile::copy( myFileName + "/points.shp", myTempDirName + "/points.shp" );
81+
QFile::copy( myFileName + "/points.shx", myTempDirName + "/points.shx" );
82+
QFile::copy( myFileName + "/points.dbf", myTempDirName + "/points.dbf" );
83+
QString myTempFileName = myTempDirName + "/points.shp";
84+
QFileInfo myMapFileInfo( myTempFileName );
8085
mpLayer = new QgsVectorLayer( myMapFileInfo.filePath(),
8186
myMapFileInfo.completeBaseName(), QStringLiteral( "ogr" ) );
8287
QgsProject::instance()->addMapLayer( mpLayer );

0 commit comments

Comments
 (0)