Skip to content

Commit

Permalink
More (probably harmless) uninitialized variables in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 7, 2015
1 parent a3668f5 commit 5160d46
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 19 deletions.
14 changes: 12 additions & 2 deletions tests/src/analysis/testqgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
class TestQgsZonalStatistics : public QObject
{
Q_OBJECT

public:
TestQgsZonalStatistics();

private slots:
void initTestCase();
void cleanupTestCase();
void init() {};
void cleanup() {};
void init() {}
void cleanup() {}

void testStatistics();

Expand All @@ -39,6 +43,12 @@ class TestQgsZonalStatistics : public QObject
QString mRasterPath;
};

TestQgsZonalStatistics::TestQgsZonalStatistics()
: mVectorLayer( NULL )
{

}

void TestQgsZonalStatistics::initTestCase()
{
QgsApplication::init();
Expand Down
14 changes: 12 additions & 2 deletions tests/src/app/testqgisappclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@
class TestQgisAppClipboard : public QObject
{
Q_OBJECT

public:
TestQgisAppClipboard();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
void init() {};// will be called before each testfunction is executed.
void cleanup() {};// will be called after every testfunction.
void init() {} // will be called before each testfunction is executed.
void cleanup() {} // will be called after every testfunction.

void copyPaste();

Expand All @@ -49,6 +53,12 @@ class TestQgisAppClipboard : public QObject
QString mTestDataDir;
};

TestQgisAppClipboard::TestQgisAppClipboard()
: mQgisApp( NULL )
{

}

//runs before all tests
void TestQgisAppClipboard::initTestCase()
{
Expand Down
10 changes: 10 additions & 0 deletions tests/src/core/regression1141.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
class Regression1141: public QObject
{
Q_OBJECT

public:
Regression1141();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand All @@ -68,6 +72,12 @@ class Regression1141: public QObject
QString mFileName;
};

Regression1141::Regression1141()
: mError( QgsVectorFileWriter::NoError )
{

}

void Regression1141::initTestCase()
{
//
Expand Down
14 changes: 12 additions & 2 deletions tests/src/core/regression992.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@
class Regression992 : public QObject
{
Q_OBJECT

public:
Regression992();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
void init() {};// will be called before each testfunction is executed.
void cleanup() {};// will be called after every testfunction.
void init() {}// will be called before each testfunction is executed.
void cleanup() {}// will be called after every testfunction.

void regression992();
private:
Expand All @@ -57,6 +61,12 @@ class Regression992 : public QObject
QString mReport;
};

Regression992::Regression992()
: mpRasterLayer( NULL )
{

}

//runs before all tests
void Regression992::initTestCase()
{
Expand Down
10 changes: 10 additions & 0 deletions tests/src/core/testqgscomposerhtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
class TestQgsComposerHtml : public QObject
{
Q_OBJECT

public:
TestQgsComposerHtml();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand All @@ -46,6 +50,12 @@ class TestQgsComposerHtml : public QObject
QFont mTestFont;
};

TestQgsComposerHtml::TestQgsComposerHtml()
: mComposition( NULL )
{

}

void TestQgsComposerHtml::initTestCase()
{
QgsApplication::init();
Expand Down
11 changes: 11 additions & 0 deletions tests/src/core/testqgscomposermapgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
class TestQgsComposerMapGrid : public QObject
{
Q_OBJECT

public:
TestQgsComposerMapGrid();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand Down Expand Up @@ -61,6 +65,13 @@ class TestQgsComposerMapGrid : public QObject
QString mReport;
};

TestQgsComposerMapGrid::TestQgsComposerMapGrid()
: mComposition( NULL )
, mComposerMap( NULL )
{

}

void TestQgsComposerMapGrid::initTestCase()
{
QgsApplication::init();
Expand Down
10 changes: 10 additions & 0 deletions tests/src/core/testqgscomposermultiframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
class TestQgsComposerMultiFrame : public QObject
{
Q_OBJECT

public:
TestQgsComposerMultiFrame();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand All @@ -43,6 +47,12 @@ class TestQgsComposerMultiFrame : public QObject
QString mReport;
};

TestQgsComposerMultiFrame::TestQgsComposerMultiFrame()
: mComposition( NULL )
{

}

void TestQgsComposerMultiFrame::initTestCase()
{
mComposition = new QgsComposition( mMapSettings );
Expand Down
10 changes: 10 additions & 0 deletions tests/src/core/testqgscomposerobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
class TestQgsComposerObject : public QObject
{
Q_OBJECT

public:
TestQgsComposerObject();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand All @@ -45,6 +49,12 @@ class TestQgsComposerObject : public QObject

};

TestQgsComposerObject::TestQgsComposerObject()
: mComposition( NULL )
{

}

void TestQgsComposerObject::initTestCase()
{
mComposition = new QgsComposition( mMapSettings );
Expand Down
11 changes: 11 additions & 0 deletions tests/src/core/testqgscomposerpicture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
class TestQgsComposerPicture : public QObject
{
Q_OBJECT

public:
TestQgsComposerPicture();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand Down Expand Up @@ -66,6 +70,13 @@ class TestQgsComposerPicture : public QObject
QString mSvgImage;
};

TestQgsComposerPicture::TestQgsComposerPicture()
: mComposition( NULL )
, mComposerPicture( NULL )
{

}

void TestQgsComposerPicture::initTestCase()
{
QgsApplication::init();
Expand Down
9 changes: 9 additions & 0 deletions tests/src/core/testqgscomposerutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
class TestQgsComposerUtils : public QObject
{
Q_OBJECT
public:
TestQgsComposerUtils();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand Down Expand Up @@ -66,6 +69,12 @@ class TestQgsComposerUtils : public QObject

};

TestQgsComposerUtils::TestQgsComposerUtils()
: mComposition( NULL )
{

}

void TestQgsComposerUtils::initTestCase()
{
QgsApplication::init();
Expand Down
9 changes: 9 additions & 0 deletions tests/src/core/testqgscomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class TestQgsComposition : public QObject
{
Q_OBJECT

public:
TestQgsComposition();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand All @@ -47,6 +50,12 @@ class TestQgsComposition : public QObject
QString mReport;
};

TestQgsComposition::TestQgsComposition()
: mComposition( NULL )
{

}

void TestQgsComposition::initTestCase()
{
QgsApplication::init();
Expand Down
13 changes: 11 additions & 2 deletions tests/src/core/testqgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ class TestQgsDataItem : public QObject
{
Q_OBJECT

public:
TestQgsDataItem();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
void init() {};// will be called before each testfunction is executed.
void cleanup() {};// will be called after every testfunction.
void init() {} // will be called before each testfunction is executed.
void cleanup() {} // will be called after every testfunction.

void testValid();
void testDirItemChildren();
Expand All @@ -46,6 +49,12 @@ class TestQgsDataItem : public QObject
bool isValidDirItem( QgsDirectoryItem *item );
};

TestQgsDataItem::TestQgsDataItem()
: mDirItem( NULL )
{

}

void TestQgsDataItem::initTestCase()
{
//
Expand Down
14 changes: 14 additions & 0 deletions tests/src/core/testqgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
class TestQgsGeometry : public QObject
{
Q_OBJECT

public:
TestQgsGeometry();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand Down Expand Up @@ -108,6 +112,16 @@ class TestQgsGeometry : public QObject
QString mReport;
};

TestQgsGeometry::TestQgsGeometry()
: mpPolylineGeometryD( NULL )
, mpPolygonGeometryA( NULL )
, mpPolygonGeometryB( NULL )
, mpPolygonGeometryC( NULL )
, mpPainter( NULL )
{

}


void TestQgsGeometry::init()
{
Expand Down
15 changes: 13 additions & 2 deletions tests/src/core/testqgsinvertedpolygonrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
class TestQgsInvertedPolygon : public QObject
{
Q_OBJECT

public:
TestQgsInvertedPolygon();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
void init() {};// will be called before each testfunction is executed.
void cleanup() {};// will be called after every testfunction.
void init() {} // will be called before each testfunction is executed.
void cleanup() {} // will be called after every testfunction.

void singleSubRenderer();
void graduatedSubRenderer();
Expand All @@ -61,6 +65,13 @@ class TestQgsInvertedPolygon : public QObject
};


TestQgsInvertedPolygon::TestQgsInvertedPolygon()
: mTestHasError( false )
, mpPolysLayer( NULL )
{

}

void TestQgsInvertedPolygon::initTestCase()
{
mTestHasError = false;
Expand Down
Loading

0 comments on commit 5160d46

Please sign in to comment.