From 55cb04c52cbbfe6eba9e3d29b2859ca92cad3008 Mon Sep 17 00:00:00 2001 From: Martin Dobias Date: Thu, 20 Feb 2014 20:24:02 +0700 Subject: [PATCH] Added unit test to check correct outcome of axisInverted() --- .../core/testqgscoordinatereferencesystem.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/src/core/testqgscoordinatereferencesystem.cpp b/tests/src/core/testqgscoordinatereferencesystem.cpp index 900b6812bdf3..6a20be040a7a 100644 --- a/tests/src/core/testqgscoordinatereferencesystem.cpp +++ b/tests/src/core/testqgscoordinatereferencesystem.cpp @@ -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() @@ -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 ) {