Skip to content

Commit 35b3e9b

Browse files
committedMay 21, 2018
Add unit test for geoccs descriptions imported from GDAL
1 parent 310bfb1 commit 35b3e9b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎tests/src/core/testqgscoordinatereferencesystem.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class TestQgsCoordinateReferenceSystem: public QObject
8080
void saveAsUserCrs();
8181
void projectWithCustomCrs();
8282
void projectEPSG25833();
83+
void geoCcsDescription();
8384

8485
private:
8586
void debugPrint( QgsCoordinateReferenceSystem &crs );
@@ -893,5 +894,25 @@ void TestQgsCoordinateReferenceSystem::projectEPSG25833()
893894
QVERIFY( p.crs().authid() == QStringLiteral( "EPSG:25833" ) );
894895
QCOMPARE( spyCrsChanged.count(), 1 );
895896
}
897+
898+
void TestQgsCoordinateReferenceSystem::geoCcsDescription()
899+
{
900+
// test that geoccs crs descriptions are correctly imported from GDAL
901+
QgsCoordinateReferenceSystem crs;
902+
crs.createFromString( QStringLiteral( "EPSG:3822" ) );
903+
QVERIFY( crs.isValid() );
904+
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:3822" ) );
905+
QCOMPARE( crs.description(), QStringLiteral( "TWD97" ) );
906+
907+
crs.createFromString( QStringLiteral( "EPSG:4340" ) );
908+
QVERIFY( crs.isValid() );
909+
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:4340" ) );
910+
QCOMPARE( crs.description(), QStringLiteral( "Australian Antarctic (geocentric)" ) );
911+
912+
crs.createFromString( QStringLiteral( "EPSG:4348" ) );
913+
QVERIFY( crs.isValid() );
914+
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:4348" ) );
915+
QCOMPARE( crs.description(), QStringLiteral( "GDA94 (geocentric)" ) );
916+
}
896917
QGSTEST_MAIN( TestQgsCoordinateReferenceSystem )
897918
#include "testqgscoordinatereferencesystem.moc"

0 commit comments

Comments
 (0)
Please sign in to comment.