Skip to content
Permalink
Browse files

Fix Coverity warnings in testqgsogcutils.cpp and testqgsgdalprovider.cpp

  • Loading branch information
rouault committed Jun 1, 2016
1 parent 2b1560c commit 73ab289e1bfae26c0d582aec6dc954db63559486
Showing with 10 additions and 3 deletions.
  1. +2 −1 tests/src/core/testqgsogcutils.cpp
  2. +8 −2 tests/src/providers/testqgsgdalprovider.cpp
@@ -432,7 +432,8 @@ void TestQgsOgcUtils::testExpressionToOgcFilterWFS11_data()
static QString normalizeXML( const QString& xmlText )
{
QDomDocument doc;
doc.setContent( xmlText, true );
if ( !doc.setContent( xmlText, true ) )
return QString();
return doc.toString( -1 );
}

@@ -117,7 +117,10 @@ void TestQgsGdalProvider::noData()
QVERIFY( provider->isValid() );
QgsRasterDataProvider* rp = dynamic_cast< QgsRasterDataProvider* >( provider );
QVERIFY( rp );
QCOMPARE( rp->srcNoDataValue( 1 ), static_cast<double>( 255 ) );
if ( rp )
{
QCOMPARE( rp->srcNoDataValue( 1 ), static_cast<double>( 255 ) );
}
delete provider;
}

@@ -128,7 +131,10 @@ void TestQgsGdalProvider::invalidNoDataInSourceIgnored()
QVERIFY( provider->isValid() );
QgsRasterDataProvider* rp = dynamic_cast< QgsRasterDataProvider* >( provider );
QVERIFY( rp );
QCOMPARE( rp->srcHasNoDataValue( 1 ), false );
if ( rp )
{
QCOMPARE( rp->srcHasNoDataValue( 1 ), false );
}
delete provider;
}

0 comments on commit 73ab289

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