Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 28, 2012
1 parent e3868cf commit a45e5b1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -210,13 +210,15 @@ void TestQgsCoordinateReferenceSystem::createFromESRIWkt()
CPLSetConfigOption( "GDAL_FIX_ESRI_WKT", configOld );
myCrs.createFromUserInput( "ESRI::" + myWktStrings[i] );
msg = testESRIWkt( i, myCrs );
if ( GDAL_VERSION_NUM <= myGdalVersionOK[i] )
if ( GDAL_VERSION_NUM < myGdalVersionOK[i] )
{
QEXPECT_FAIL( "", QString( "expected failure with GDAL %1 : %2"
).arg( GDAL_VERSION_NUM ).arg( msg ).toLocal8Bit().constData(),
Continue );
}
QVERIFY2( msg == "", msg.toLocal8Bit().constData() );

if ( !msg.isEmpty() )
QVERIFY2( false, msg.toLocal8Bit().constData() );

// do test with shapefiles
CPLSetConfigOption( "GDAL_FIX_ESRI_WKT", configOld );
Expand All @@ -230,20 +232,21 @@ void TestQgsCoordinateReferenceSystem::createFromESRIWkt()
QgsVectorLayer *myLayer = new QgsVectorLayer( fileStr, "", "ogr" );
if ( !myLayer || ! myLayer->isValid() )
{
QVERIFY2( false, QString( "test %1 did not get valid vector layer from %2"
).arg( i ).arg( fileStr ).toLocal8Bit().constData() );
qWarning() << QString( "test %1 did not get valid vector layer from %2" ).arg( i ).arg( fileStr );
QVERIFY2( false, "no valid vector layer" );
}
else
{
myCrs = myLayer->crs();
msg = testESRIWkt( i, myCrs );
if ( GDAL_VERSION_NUM <= myGdalVersionOK[i] )
if ( GDAL_VERSION_NUM < myGdalVersionOK[i] )
{
QEXPECT_FAIL( "", QString( "expected failure with GDAL %1 : %2 using layer %3"
).arg( GDAL_VERSION_NUM ).arg( msg ).arg( fileStr ).toLocal8Bit().constData(),
Continue );
}
QVERIFY2( msg == "", msg.toLocal8Bit().constData() );
if ( !msg.isEmpty() )
QVERIFY2( false, msg.toLocal8Bit().constData() );
}
if ( myLayer )
delete myLayer;
Expand Down

0 comments on commit a45e5b1

Please sign in to comment.