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
This commit is contained in:
timlinux 2008-07-06 11:36:54 +00:00
parent fce1098c93
commit 63b3d29180
2 changed files with 4 additions and 7 deletions

View File

@ -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

View File

@ -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);
@ -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,