Skip to content
Permalink
Browse files
Applied patch from Etienne to make gzip/zip tests run under linux
  • Loading branch information
timlinux committed May 1, 2012
1 parent 0b8e113 commit 82ef4d1725a09ca6fad0fc8bf2d1e6ce0de211a6
Showing with 13 additions and 2 deletions.
  1. +13 −2 tests/src/core/testziplayer.cpp
@@ -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();
};
@@ -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;
@@ -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 );
@@ -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() );

1 comment on commit 82ef4d1

@etiennesky

This comment has been minimized.

Copy link
Contributor

@etiennesky etiennesky commented on 82ef4d1 May 2, 2012

great, now the tests pass in linux!

Please sign in to comment.