Skip to content

Commit

Permalink
Applied patch from Etienne to make gzip/zip tests run under linux
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed May 1, 2012
1 parent 0b8e113 commit 82ef4d1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/src/core/testziplayer.cpp
Expand Up @@ -75,7 +75,7 @@ class TestZipLayer: public QObject
void testZipItemAll();
// test that styles are loaded from .qml files outside zip files
void testZipItemVectorTransparency();
void testGipItemVectorTransparency();
void testGZipItemVectorTransparency();
void testZipItemRasterTransparency();
void testGZipItemRasterTransparency();
};
Expand Down Expand Up @@ -199,6 +199,8 @@ int TestZipLayer::getLayerTransparency( QString myFileName, QString myProviderKe
myLayer = getZipLayer( myFileName, "" );
if ( myLayer && myLayer->isValid() )
myTransparency = myLayer->getTransparency();
else
QWARN( QString( "Could not open filename %1 using %2 provider" ).arg( myFileName ).arg( myProviderKey ).toLocal8Bit().data() );
if ( myLayer )
delete myLayer;
return myTransparency;
Expand Down Expand Up @@ -247,6 +249,9 @@ void TestZipLayer::testPassthruVectorZip()

void TestZipLayer::testPassthruVectorGzip()
{
#if GDAL_VERSION_NUM < 1700
QSKIP( "This test requires GDAL > 1.7", SkipSingle );
#endif
for ( int i = 1 ; i <= mMaxScanZipSetting ; i++ )
{
mSettings.setValue( "/qgis/scanZipInBrowser", i );
Expand Down Expand Up @@ -313,15 +318,21 @@ void TestZipLayer::testZipItemAll()

void TestZipLayer::testZipItemVectorTransparency()
{
#if GDAL_VERSION_NUM < 1800
QSKIP( "This test requires GDAL > 1.8", SkipSingle );
#endif
int myTarget = 250;
int myTransparency = getLayerTransparency( mDataDir + "points2.zip", "ogr", 1 );
QVERIFY2(( myTransparency == myTarget ), QString( "Transparency is %1, should be %2" ).arg( myTransparency ).arg( myTarget ).toLocal8Bit().data() );
myTransparency = getLayerTransparency( mDataDir + "points2.zip", "ogr", 2 );
QVERIFY2(( myTransparency == myTarget ), QString( "Transparency is %1, should be %2" ).arg( myTransparency ).arg( myTarget ).toLocal8Bit().data() );
}

void TestZipLayer::testGipItemVectorTransparency()
void TestZipLayer::testGZipItemVectorTransparency()
{
#if GDAL_VERSION_NUM < 1700
QSKIP( "This test requires GDAL > 1.7", SkipSingle );
#endif
int myTarget = 250;
int myTransparency = getLayerTransparency( mDataDir + "points3.geojson.gz", "ogr", 1 );
QVERIFY2(( myTransparency == myTarget ), QString( "Transparency is %1, should be %2" ).arg( myTransparency ).arg( myTarget ).toLocal8Bit().data() );
Expand Down

1 comment on commit 82ef4d1

@etiennesky
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, now the tests pass in linux!

Please sign in to comment.