Skip to content

Commit

Permalink
Add unit test for geoccs descriptions imported from GDAL
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2018
1 parent 310bfb1 commit 35b3e9b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -80,6 +80,7 @@ class TestQgsCoordinateReferenceSystem: public QObject
void saveAsUserCrs();
void projectWithCustomCrs();
void projectEPSG25833();
void geoCcsDescription();

private:
void debugPrint( QgsCoordinateReferenceSystem &crs );
Expand Down Expand Up @@ -893,5 +894,25 @@ void TestQgsCoordinateReferenceSystem::projectEPSG25833()
QVERIFY( p.crs().authid() == QStringLiteral( "EPSG:25833" ) );
QCOMPARE( spyCrsChanged.count(), 1 );
}

void TestQgsCoordinateReferenceSystem::geoCcsDescription()
{
// test that geoccs crs descriptions are correctly imported from GDAL
QgsCoordinateReferenceSystem crs;
crs.createFromString( QStringLiteral( "EPSG:3822" ) );
QVERIFY( crs.isValid() );
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:3822" ) );
QCOMPARE( crs.description(), QStringLiteral( "TWD97" ) );

crs.createFromString( QStringLiteral( "EPSG:4340" ) );
QVERIFY( crs.isValid() );
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:4340" ) );
QCOMPARE( crs.description(), QStringLiteral( "Australian Antarctic (geocentric)" ) );

crs.createFromString( QStringLiteral( "EPSG:4348" ) );
QVERIFY( crs.isValid() );
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:4348" ) );
QCOMPARE( crs.description(), QStringLiteral( "GDA94 (geocentric)" ) );
}
QGSTEST_MAIN( TestQgsCoordinateReferenceSystem )
#include "testqgscoordinatereferencesystem.moc"

0 comments on commit 35b3e9b

Please sign in to comment.