Skip to content

Commit db1c3d9

Browse files
committed
test cleanups
1 parent c5ea708 commit db1c3d9

19 files changed

+22
-469
lines changed

tests/bench/main.cpp

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

+3-10
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

+2-6
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

+1-2
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

-41
This file was deleted.

tests/src/core/test_builder.pl

-188
This file was deleted.

tests/src/core/test_suite_builder.sh

-24
This file was deleted.

tests/src/core/testqgsapplication.cpp

+2-2
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

+2-2
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

+1-2
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

+1-1
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

+1-2
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
}

0 commit comments

Comments
 (0)