Skip to content

Commit 63b3d29

Browse files
author
timlinux
committedJul 6, 2008
Fixed broken filewriter unit test by changes in qgsapplication by adding a mechanism to find the install root of
qgis. git-svn-id: http://svn.osgeo.org/qgis/trunk@8712 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fce1098 commit 63b3d29

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
 

‎tests/src/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ENDIF (WIN32)
4141
# the TEST_DATA_DIR variable is set in the top level CMakeLists.txt
4242
ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")
4343

44+
ADD_DEFINITIONS(-DINSTALL_PREFIX="\\"${CMAKE_INSTALL_PREFIX}\\"")
4445
#############################################################
4546
# libraries
4647

‎tests/src/core/testqgsvectorfilewriter.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,10 @@ void TestQgsVectorFileWriter::initTestCase()
9393
"******************\n");
9494
// init QGIS's paths - true means that all path will be inited from prefix
9595
QString qgisPath = QCoreApplication::applicationDirPath ();
96-
QgsApplication::setPrefixPath(qgisPath, TRUE);
96+
QgsApplication::setPrefixPath(INSTALL_PREFIX, true);
97+
QgsApplication::showSettings();
9798
//create some objects that will be used in all tests...
9899

99-
std::cout << "Prefix PATH: " << QgsApplication::prefixPath().toLocal8Bit().data() << std::endl;
100-
std::cout << "Plugin PATH: " << QgsApplication::pluginPath().toLocal8Bit().data() << std::endl;
101-
std::cout << "PkgData PATH: " << QgsApplication::pkgDataPath().toLocal8Bit().data() << std::endl;
102-
std::cout << "User DB PATH: " << QgsApplication::qgisUserDbFilePath().toLocal8Bit().data() << std::endl;
103-
104100
mEncoding = "UTF-8";
105101
QgsField myField1("Field1",QVariant::String,"String",10,0,"Field 1 comment");
106102
mFields.insert(0, myField1);
@@ -117,7 +113,7 @@ void TestQgsVectorFileWriter::createPoint()
117113
//
118114
// Remove old copies that may be lying around
119115
//
120-
QString myFileName = "testpt.shp";
116+
QString myFileName = "/testpt.shp";
121117
myFileName = QDir::tempPath() + myFileName;
122118
QVERIFY(QgsVectorFileWriter::deleteShapeFile(myFileName));
123119
QgsVectorFileWriter myWriter (myFileName,

0 commit comments

Comments
 (0)
Please sign in to comment.