Skip to content
Permalink
Browse files

Add unit test for geoccs descriptions imported from GDAL

  • Loading branch information
nyalldawson committed May 20, 2018
1 parent 310bfb1 commit 35b3e9bb63fc211fc8a876dad14865794a0dc1f8
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/src/core/testqgscoordinatereferencesystem.cpp
@@ -80,6 +80,7 @@ class TestQgsCoordinateReferenceSystem: public QObject
void saveAsUserCrs();
void projectWithCustomCrs();
void projectEPSG25833();
void geoCcsDescription();

private:
void debugPrint( QgsCoordinateReferenceSystem &crs );
@@ -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.
You can’t perform that action at this time.