Skip to content

Commit

Permalink
Added unit test to check correct outcome of axisInverted()
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Feb 20, 2014
1 parent c784c09 commit 55cb04c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -60,6 +60,7 @@ class TestQgsCoordinateReferenceSystem: public QObject
void geographicFlag();
void mapUnits();
void setValidationHint();
void axisInverted();
private:
void debugPrint( QgsCoordinateReferenceSystem &theCrs );
// these used by createFromESRIWkt()
Expand Down Expand Up @@ -410,6 +411,22 @@ void TestQgsCoordinateReferenceSystem::setValidationHint()
debugPrint( myCrs );
}

void TestQgsCoordinateReferenceSystem::axisInverted()
{
// this is used by WMS 1.3 to determine whether to switch axes or not

QgsCoordinateReferenceSystem crs;
crs.createFromOgcWmsCrs( "EPSG:4326" ); // WGS 84 with inverted axes
QVERIFY( crs.axisInverted() );

crs.createFromOgcWmsCrs( "CRS:84" ); // WGS 84 without inverted axes
QVERIFY( !crs.axisInverted() );

crs.createFromOgcWmsCrs( "EPSG:32633" ); // "WGS 84 / UTM zone 33N" - projected CRS without invertex axes
QVERIFY( !crs.axisInverted() );
}


void TestQgsCoordinateReferenceSystem::debugPrint(
QgsCoordinateReferenceSystem &theCrs )
{
Expand Down

0 comments on commit 55cb04c

Please sign in to comment.