[QGIS Commit] r8712 - trunk/qgis/tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Jul 6 07:36:54 EDT 2008


Author: timlinux
Date: 2008-07-06 07:36:54 -0400 (Sun, 06 Jul 2008)
New Revision: 8712

Modified:
   trunk/qgis/tests/src/core/CMakeLists.txt
   trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp
Log:
Fixed broken filewriter unit test by changes in qgsapplication by adding a mechanism to find the install root of 
qgis.


Modified: trunk/qgis/tests/src/core/CMakeLists.txt
===================================================================
--- trunk/qgis/tests/src/core/CMakeLists.txt	2008-07-05 19:44:35 UTC (rev 8711)
+++ trunk/qgis/tests/src/core/CMakeLists.txt	2008-07-06 11:36:54 UTC (rev 8712)
@@ -41,6 +41,7 @@
 # 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
 

Modified: trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp	2008-07-05 19:44:35 UTC (rev 8711)
+++ trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp	2008-07-06 11:36:54 UTC (rev 8712)
@@ -93,14 +93,10 @@
       "******************\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 @@
   //
   // 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,



More information about the QGIS-commit mailing list