Skip to content
Permalink
Browse files

fix tests

  • Loading branch information
jef-n committed May 28, 2012
1 parent e3868cf commit a45e5b19c285765d21b872cd57edbffc1c11a83f
Showing with 9 additions and 6 deletions.
  1. +9 −6 tests/src/core/testqgscoordinatereferencesystem.cpp
@@ -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 );
@@ -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;

0 comments on commit a45e5b1

Please sign in to comment.
You can’t perform that action at this time.