Skip to content

Commit db1c3d9

Browse files
committedMay 6, 2012
test cleanups
1 parent c5ea708 commit db1c3d9

19 files changed

+22
-469
lines changed
 

‎tests/bench/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ typedef SInt32 SRefCon;
5050
#endif
5151
#endif
5252

53-
//#include "qgspluginregistry.h"
5453
#include "qgsbench.h"
55-
//#include "qgsmapcanvas.h"
5654
#include "qgsapplication.h"
5755
#include <qgsconfig.h>
5856
#include <qgsversion.h>

‎tests/src/analysis/testqgsvectoranalyzer.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ void TestQgsVectorAnalyzer::initTestCase()
5050
// Runs once before any tests are run
5151
//
5252
// init QGIS's paths - true means that all path will be inited from prefix
53-
QString qgisPath = QCoreApplication::applicationDirPath();
54-
QgsApplication::init( INSTALL_PREFIX );
55-
QgsApplication::initQgis( );
53+
QgsApplication::init();
54+
QgsApplication::initQgis();
5655
QgsApplication::showSettings();
57-
// Instantiate the plugin directory so that providers are loaded
58-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
5956

6057
//create some objects that will be used in all tests...
6158
//create a map layer that will be used in all tests...
@@ -91,7 +88,6 @@ void TestQgsVectorAnalyzer::cleanup()
9188
{
9289

9390
}
94-
9591
void TestQgsVectorAnalyzer::singleToMulti( )
9692
{
9793

@@ -116,9 +112,7 @@ void TestQgsVectorAnalyzer::simplifyGeometry( )
116112
{
117113
QString myTmpDir = QDir::tempPath() + QDir::separator() ;
118114
QString myFileName = myTmpDir + "simplify_layer.shp";
119-
QVERIFY( mAnalyzer.simplify( mpLineLayer,
120-
myFileName,
121-
1.0 ) );
115+
QVERIFY( mAnalyzer.simplify( mpLineLayer, myFileName, 1.0 ) );
122116
}
123117

124118
void TestQgsVectorAnalyzer::polygonCentroids( )
@@ -137,4 +131,3 @@ void TestQgsVectorAnalyzer::layerExtent( )
137131

138132
QTEST_MAIN( TestQgsVectorAnalyzer )
139133
#include "moc_testqgsvectoranalyzer.cxx"
140-

‎tests/src/core/regression1141.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@ void Regression1141::initTestCase()
7171
// Runs once before any tests are run
7272
//
7373
// init QGIS's paths - true means that all path will be inited from prefix
74-
QString qgisPath = QCoreApplication::applicationDirPath();
75-
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
74+
QgsApplication::init();
75+
QgsApplication::initQgis();
7676
QgsApplication::showSettings();
77-
// Instantiate the plugin directory so that providers are loaded
78-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
7977
// compute our test file name:
8078
QString myTmpDir = QDir::tempPath() + QDir::separator() ;
8179
mFileName = myTmpDir + "ąęćń.shp";
@@ -149,6 +147,4 @@ void Regression1141::diacriticalTest()
149147

150148

151149
QTEST_MAIN( Regression1141 )
152-
153150
#include "moc_regression1141.cxx"
154-

‎tests/src/core/regression992.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void Regression992::initTestCase()
7070
QgsApplication::showSettings();
7171
// QgsApplication::skipGdalDriver( "JP2ECW" );
7272
// QgsApplication::skipGdalDriver( "JP2MrSID" );
73-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
73+
QgsApplication::initQgis();
7474

7575
//create some objects that will be used in all tests...
7676
//create a raster layer that will be used in all tests...
@@ -132,4 +132,3 @@ void Regression992::regression992()
132132

133133
QTEST_MAIN( Regression992 )
134134
#include "moc_regression992.cxx"
135-

‎tests/src/core/runtests.sh

Lines changed: 0 additions & 41 deletions
This file was deleted.

‎tests/src/core/test_builder.pl

Lines changed: 0 additions & 188 deletions
This file was deleted.

‎tests/src/core/test_suite_builder.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎tests/src/core/testqgsapplication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ void TestQgsApplication::initTestCase()
4141
// Runs once before any tests are run
4242
//
4343
// init QGIS's paths - true means that all path will be inited from prefix
44-
//QString qgisPath = QCoreApplication::applicationDirPath();
45-
QgsApplication::init( INSTALL_PREFIX );
44+
QgsApplication::init();
45+
QgsApplication::initQgis();
4646
qDebug( "%s", QgsApplication::showSettings().toUtf8().constData() );
4747
};
4848

‎tests/src/core/testqgsgeometry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ void TestQgsGeometry::initTestCase()
185185
// Runs once before any tests are run
186186
//
187187
// init QGIS's paths - true means that all path will be inited from prefix
188-
QString qgisPath = QCoreApplication::applicationDirPath();
189-
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
188+
QgsApplication::init();
189+
QgsApplication::initQgis();
190190
QgsApplication::showSettings();
191191
mReport += "<h1>Geometry Tests</h1>\n";
192192
mReport += "<p><font color=\"green\">Green = polygonA</font></p>\n";

‎tests/src/core/testqgsmaplayer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ void TestQgsMapLayer::initTestCase()
5252
//
5353
// init QGIS's paths - true means that all path will be inited from prefix
5454
QgsApplication::init();
55+
QgsApplication::initQgis();
5556
QgsApplication::showSettings();
56-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
5757

5858
//create some objects that will be used in all tests...
5959
//create a map layer that will be used in all tests...
@@ -71,4 +71,3 @@ void TestQgsMapLayer::isValid()
7171

7272
QTEST_MAIN( TestQgsMapLayer )
7373
#include "moc_testqgsmaplayer.cxx"
74-

‎tests/src/core/testqgsmaprenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void TestQgsMapRenderer::initTestCase()
7878
// Runs once before any tests are run
7979
//
8080
QgsApplication::init();
81+
QgsApplication::initQgis();
8182
QgsApplication::showSettings();
82-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
8383

8484
//create some objects that will be used in all tests...
8585
mEncoding = "UTF-8";

‎tests/src/core/testqgspoint.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ void TestQgsPoint::initTestCase()
7272
// Runs once before any tests are run
7373
//
7474
// init QGIS's paths - true means that all path will be inited from prefix
75-
QString qgisPath = QCoreApplication::applicationDirPath();
76-
QgsApplication::init( INSTALL_PREFIX );
75+
QgsApplication::init();
7776
QgsApplication::showSettings();
7877
mReport += "<h1>Point Tests</h1>\n";
7978
}

‎tests/src/core/testqgsrenderers.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,12 @@ void TestQgsRenderers::initTestCase()
6666
{
6767
mTestHasError = false;
6868
// init QGIS's paths - true means that all path will be inited from prefix
69-
QString qgisPath = QCoreApplication::applicationDirPath();
70-
QgsApplication::init( INSTALL_PREFIX );
71-
QgsApplication::initQgis( );
69+
QgsApplication::init();
70+
QgsApplication::initQgis();
7271
QgsApplication::showSettings();
73-
// Instantiate the plugin directory so that providers are loaded
74-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
7572

7673
//create some objects that will be used in all tests...
7774

78-
std::cout << "Prefix PATH: " << QgsApplication::prefixPath().toLocal8Bit().data() << std::endl;
79-
std::cout << "Plugin PATH: " << QgsApplication::pluginPath().toLocal8Bit().data() << std::endl;
80-
std::cout << "PkgData PATH: " << QgsApplication::pkgDataPath().toLocal8Bit().data() << std::endl;
81-
std::cout << "User DB PATH: " << QgsApplication::qgisUserDbFilePath().toLocal8Bit().data() << std::endl;
8275

8376
//
8477
//create a point layer that will be used in all tests...
@@ -225,4 +218,3 @@ bool TestQgsRenderers::imageCheck( QString theTestType )
225218

226219
QTEST_MAIN( TestQgsRenderers )
227220
#include "moc_testqgsrenderers.cxx"
228-

‎tests/src/core/testqgsvectorfilewriter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ void TestQgsVectorFileWriter::initTestCase()
9292
"(the ERROR comes from OGR and is not very intuitive)\n"
9393
"******************\n" );
9494
// init QGIS's paths - true means that all path will be inited from prefix
95-
QString qgisPath = QCoreApplication::applicationDirPath();
96-
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
95+
QgsApplication::init();
9796
QgsApplication::showSettings();
9897
//create some objects that will be used in all tests...
9998

‎tests/src/core/testqgsvectorlayer.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,11 @@ class TestQgsVectorLayer: public QObject
5858
{
5959
mTestHasError = false;
6060
QgsApplication::init();
61+
QgsApplication::initQgis();
6162
QgsApplication::showSettings();
62-
// Instantiate the plugin directory so that providers are loaded
63-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
6463

6564
//create some objects that will be used in all tests...
6665

67-
std::cout << "Prefix PATH: " << QgsApplication::prefixPath().toLocal8Bit().data() << std::endl;
68-
std::cout << "Plugin PATH: " << QgsApplication::pluginPath().toLocal8Bit().data() << std::endl;
69-
std::cout << "PkgData PATH: " << QgsApplication::pkgDataPath().toLocal8Bit().data() << std::endl;
70-
std::cout << "User DB PATH: " << QgsApplication::qgisUserDbFilePath().toLocal8Bit().data() << std::endl;
71-
7266
//
7367
//create a non spatial layer that will be used in all tests...
7468
//
@@ -649,7 +643,3 @@ class TestQgsVectorLayer: public QObject
649643

650644
QTEST_MAIN( TestQgsVectorLayer )
651645
#include "moc_testqgsvectorlayer.cxx"
652-
653-
654-
655-

‎tests/src/core/testziplayer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ int TestZipLayer::getLayerTransparency( QString myFileName, QString myProviderKe
211211
void TestZipLayer::initTestCase()
212212
{
213213
QgsApplication::init();
214-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
214+
QgsApplication::initQgis();
215215
// save data dir
216216
mDataDir = QString( TEST_DATA_DIR ) + QDir::separator();
217217
// set zipSetting to 1 (Passthru) and save current value
@@ -358,6 +358,5 @@ void TestZipLayer::testGZipItemRasterTransparency()
358358
QVERIFY2(( myTransparency == myTarget ), QString( "Transparency is %1, should be %2" ).arg( myTransparency ).arg( myTarget ).toLocal8Bit().data() );
359359
}
360360

361-
362361
QTEST_MAIN( TestZipLayer )
363362
#include "moc_testziplayer.cxx"

‎tests/src/gui/testqgsmaptoolzoom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class TestQgsMapToolZoom: public QObject
4040

4141
void TestQgsMapToolZoom::initTestCase()
4242
{
43-
QString qgisPath = QCoreApplication::applicationDirPath();
44-
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
43+
QgsApplication::init();
44+
QgsApplication::initQgis();
4545
QgsApplication::showSettings();
4646
}
4747

‎tests/src/gui/testqgsquickprint.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ void TestQgsQuickPrint::initTestCase()
6262
// Runs once before any tests are run
6363
//
6464
// init QGIS's paths - true means that all path will be inited from prefix
65-
QString qgisPath = QCoreApplication::applicationDirPath();
66-
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
65+
QgsApplication.init();
66+
QgsApplication.initQgis();
6767
QgsApplication::showSettings();
68-
// Instantiate the plugin directory so that providers are loaded
69-
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
7068

7169
//
7270
//create a point layer that will be used in all tests...

‎tests/src/runtests.sh

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.