Skip to content

Commit

Permalink
Fix leak in test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 2, 2016
1 parent c672ce2 commit 7af3366
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/src/core/testqgscomposition.cpp
Expand Up @@ -536,6 +536,7 @@ void TestQgsComposition::georeference()
QVERIFY( qgsDoubleNear( t[3], 3200, 1 ) ); QVERIFY( qgsDoubleNear( t[3], 3200, 1 ) );
QVERIFY( qgsDoubleNear( t[4], 0.0 ) ); QVERIFY( qgsDoubleNear( t[4], 0.0 ) );
QVERIFY( qgsDoubleNear( t[5], -0.211694, 0.0001 ) ); QVERIFY( qgsDoubleNear( t[5], -0.211694, 0.0001 ) );
delete[] t;


// don't specify map // don't specify map
composition->setWorldFileMap( map ); composition->setWorldFileMap( map );
Expand All @@ -546,6 +547,7 @@ void TestQgsComposition::georeference()
QVERIFY( qgsDoubleNear( t[3], 3200, 1 ) ); QVERIFY( qgsDoubleNear( t[3], 3200, 1 ) );
QVERIFY( qgsDoubleNear( t[4], 0.0 ) ); QVERIFY( qgsDoubleNear( t[4], 0.0 ) );
QVERIFY( qgsDoubleNear( t[5], -0.211694, 0.0001 ) ); QVERIFY( qgsDoubleNear( t[5], -0.211694, 0.0001 ) );
delete[] t;


// specify extent // specify extent
t = composition->computeGeoTransform( map, QRectF( 70, 100, 50, 60 ) ); t = composition->computeGeoTransform( map, QRectF( 70, 100, 50, 60 ) );
Expand All @@ -555,6 +557,7 @@ void TestQgsComposition::georeference()
QVERIFY( qgsDoubleNear( t[3], 2950, 1 ) ); QVERIFY( qgsDoubleNear( t[3], 2950, 1 ) );
QVERIFY( qgsDoubleNear( t[4], 0.0 ) ); QVERIFY( qgsDoubleNear( t[4], 0.0 ) );
QVERIFY( qgsDoubleNear( t[5], -0.211864, 0.0001 ) ); QVERIFY( qgsDoubleNear( t[5], -0.211864, 0.0001 ) );
delete[] t;


// specify dpi // specify dpi
t = composition->computeGeoTransform( map, QRectF(), 75 ); t = composition->computeGeoTransform( map, QRectF(), 75 );
Expand All @@ -564,6 +567,7 @@ void TestQgsComposition::georeference()
QVERIFY( qgsDoubleNear( t[3], 3200.0, 1 ) ); QVERIFY( qgsDoubleNear( t[3], 3200.0, 1 ) );
QVERIFY( qgsDoubleNear( t[4], 0.0 ) ); QVERIFY( qgsDoubleNear( t[4], 0.0 ) );
QVERIFY( qgsDoubleNear( t[5], -0.846774, 0.0001 ) ); QVERIFY( qgsDoubleNear( t[5], -0.846774, 0.0001 ) );
delete[] t;


// rotation // rotation
map->setMapRotation( 45 ); map->setMapRotation( 45 );
Expand All @@ -574,6 +578,7 @@ void TestQgsComposition::georeference()
QVERIFY( qgsDoubleNear( t[3], 2889.64, 1 ) ); QVERIFY( qgsDoubleNear( t[3], 2889.64, 1 ) );
QVERIFY( qgsDoubleNear( t[4], 0.14969, 0.0001 ) ); QVERIFY( qgsDoubleNear( t[4], 0.14969, 0.0001 ) );
QVERIFY( qgsDoubleNear( t[5], -0.14969, 0.0001 ) ); QVERIFY( qgsDoubleNear( t[5], -0.14969, 0.0001 ) );
delete[] t;


delete composition; delete composition;
} }
Expand Down

0 comments on commit 7af3366

Please sign in to comment.