Skip to content

Commit a45e5b1

Browse files
committed
fix tests
1 parent e3868cf commit a45e5b1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/src/core/testqgscoordinatereferencesystem.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,15 @@ void TestQgsCoordinateReferenceSystem::createFromESRIWkt()
210210
CPLSetConfigOption( "GDAL_FIX_ESRI_WKT", configOld );
211211
myCrs.createFromUserInput( "ESRI::" + myWktStrings[i] );
212212
msg = testESRIWkt( i, myCrs );
213-
if ( GDAL_VERSION_NUM <= myGdalVersionOK[i] )
213+
if ( GDAL_VERSION_NUM < myGdalVersionOK[i] )
214214
{
215215
QEXPECT_FAIL( "", QString( "expected failure with GDAL %1 : %2"
216216
).arg( GDAL_VERSION_NUM ).arg( msg ).toLocal8Bit().constData(),
217217
Continue );
218218
}
219-
QVERIFY2( msg == "", msg.toLocal8Bit().constData() );
219+
220+
if ( !msg.isEmpty() )
221+
QVERIFY2( false, msg.toLocal8Bit().constData() );
220222

221223
// do test with shapefiles
222224
CPLSetConfigOption( "GDAL_FIX_ESRI_WKT", configOld );
@@ -230,20 +232,21 @@ void TestQgsCoordinateReferenceSystem::createFromESRIWkt()
230232
QgsVectorLayer *myLayer = new QgsVectorLayer( fileStr, "", "ogr" );
231233
if ( !myLayer || ! myLayer->isValid() )
232234
{
233-
QVERIFY2( false, QString( "test %1 did not get valid vector layer from %2"
234-
).arg( i ).arg( fileStr ).toLocal8Bit().constData() );
235+
qWarning() << QString( "test %1 did not get valid vector layer from %2" ).arg( i ).arg( fileStr );
236+
QVERIFY2( false, "no valid vector layer" );
235237
}
236238
else
237239
{
238240
myCrs = myLayer->crs();
239241
msg = testESRIWkt( i, myCrs );
240-
if ( GDAL_VERSION_NUM <= myGdalVersionOK[i] )
242+
if ( GDAL_VERSION_NUM < myGdalVersionOK[i] )
241243
{
242244
QEXPECT_FAIL( "", QString( "expected failure with GDAL %1 : %2 using layer %3"
243245
).arg( GDAL_VERSION_NUM ).arg( msg ).arg( fileStr ).toLocal8Bit().constData(),
244246
Continue );
245247
}
246-
QVERIFY2( msg == "", msg.toLocal8Bit().constData() );
248+
if ( !msg.isEmpty() )
249+
QVERIFY2( false, msg.toLocal8Bit().constData() );
247250
}
248251
if ( myLayer )
249252
delete myLayer;

0 commit comments

Comments
 (0)