Skip to content

Commit

Permalink
Fixed broken filewriter unit test by changes in qgsapplication by add…
Browse files Browse the repository at this point in the history
…ing a mechanism to find the install root of

qgis.


git-svn-id: http://svn.osgeo.org/qgis/trunk@8712 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jul 6, 2008
1 parent fce1098 commit 63b3d29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/src/core/CMakeLists.txt
Expand Up @@ -41,6 +41,7 @@ ENDIF (WIN32)
# the TEST_DATA_DIR variable is set in the top level CMakeLists.txt
ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")

ADD_DEFINITIONS(-DINSTALL_PREFIX="\\"${CMAKE_INSTALL_PREFIX}\\"")
#############################################################
# libraries

Expand Down
10 changes: 3 additions & 7 deletions tests/src/core/testqgsvectorfilewriter.cpp
Expand Up @@ -93,14 +93,10 @@ void TestQgsVectorFileWriter::initTestCase()
"******************\n");
// init QGIS's paths - true means that all path will be inited from prefix
QString qgisPath = QCoreApplication::applicationDirPath ();
QgsApplication::setPrefixPath(qgisPath, TRUE);
QgsApplication::setPrefixPath(INSTALL_PREFIX, true);
QgsApplication::showSettings();
//create some objects that will be used in all tests...

std::cout << "Prefix PATH: " << QgsApplication::prefixPath().toLocal8Bit().data() << std::endl;
std::cout << "Plugin PATH: " << QgsApplication::pluginPath().toLocal8Bit().data() << std::endl;
std::cout << "PkgData PATH: " << QgsApplication::pkgDataPath().toLocal8Bit().data() << std::endl;
std::cout << "User DB PATH: " << QgsApplication::qgisUserDbFilePath().toLocal8Bit().data() << std::endl;

mEncoding = "UTF-8";
QgsField myField1("Field1",QVariant::String,"String",10,0,"Field 1 comment");
mFields.insert(0, myField1);
Expand All @@ -117,7 +113,7 @@ void TestQgsVectorFileWriter::createPoint()
//
// Remove old copies that may be lying around
//
QString myFileName = "testpt.shp";
QString myFileName = "/testpt.shp";
myFileName = QDir::tempPath() + myFileName;
QVERIFY(QgsVectorFileWriter::deleteShapeFile(myFileName));
QgsVectorFileWriter myWriter (myFileName,
Expand Down

0 comments on commit 63b3d29

Please sign in to comment.