Skip to content

Commit 55cb04c

Browse files
committedFeb 20, 2014
Added unit test to check correct outcome of axisInverted()
1 parent c784c09 commit 55cb04c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎tests/src/core/testqgscoordinatereferencesystem.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class TestQgsCoordinateReferenceSystem: public QObject
6060
void geographicFlag();
6161
void mapUnits();
6262
void setValidationHint();
63+
void axisInverted();
6364
private:
6465
void debugPrint( QgsCoordinateReferenceSystem &theCrs );
6566
// these used by createFromESRIWkt()
@@ -410,6 +411,22 @@ void TestQgsCoordinateReferenceSystem::setValidationHint()
410411
debugPrint( myCrs );
411412
}
412413

414+
void TestQgsCoordinateReferenceSystem::axisInverted()
415+
{
416+
// this is used by WMS 1.3 to determine whether to switch axes or not
417+
418+
QgsCoordinateReferenceSystem crs;
419+
crs.createFromOgcWmsCrs( "EPSG:4326" ); // WGS 84 with inverted axes
420+
QVERIFY( crs.axisInverted() );
421+
422+
crs.createFromOgcWmsCrs( "CRS:84" ); // WGS 84 without inverted axes
423+
QVERIFY( !crs.axisInverted() );
424+
425+
crs.createFromOgcWmsCrs( "EPSG:32633" ); // "WGS 84 / UTM zone 33N" - projected CRS without invertex axes
426+
QVERIFY( !crs.axisInverted() );
427+
}
428+
429+
413430
void TestQgsCoordinateReferenceSystem::debugPrint(
414431
QgsCoordinateReferenceSystem &theCrs )
415432
{

0 commit comments

Comments
 (0)
Please sign in to comment.