Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 20, 2019
1 parent 754d613 commit b3e4c28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/core/testqgslayoutgeopdfexport.cpp
Expand Up @@ -210,6 +210,7 @@ void TestQgsLayoutGeoPdfExport::testCollectingFeatures()

// finalize and test collation
QgsAbstractGeoPdfExporter::ExportDetails details;
details.pageSizeMm = QSizeF( 297, 210 );
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(3,0,0)
bool expected = false;
#else
Expand Down Expand Up @@ -249,10 +250,7 @@ void TestQgsLayoutGeoPdfExport::testCollectingFeatures()
QVERIFY( layer3->isValid() );
QCOMPARE( layer3->featureCount(), 10L );



// test for theme based export here!
l.renderContext().setExportThemes( QStringList() << QStringLiteral( "test preset2" ) << QStringLiteral( "test preset" ) << QStringLiteral( "test preset3" ) );
map2->setFollowVisibilityPreset( true );
map2->setFollowVisibilityPresetName( QStringLiteral( "test preset3" ) );

Expand All @@ -261,6 +259,7 @@ void TestQgsLayoutGeoPdfExport::testCollectingFeatures()
settings = QgsLayoutExporter::PdfExportSettings();
settings.writeGeoPdf = true;
settings.exportMetadata = false;
settings.exportThemes = QStringList() << QStringLiteral( "test preset2" ) << QStringLiteral( "test preset" ) << QStringLiteral( "test preset3" );
exporter.exportToPdf( outputFile, settings );

// check that features were collected
Expand Down Expand Up @@ -293,6 +292,7 @@ void TestQgsLayoutGeoPdfExport::testCollectingFeatures()

// finalize and test collation
details = QgsAbstractGeoPdfExporter::ExportDetails();
details.pageSizeMm = QSizeF( 297, 210 );
QCOMPARE( geoPdfExporter2.finalize( QList<QgsAbstractGeoPdfExporter::ComponentLayerDetail>(), outputFile, details ), expected );
QVERIFY( geoPdfExporter2.errorMessage().isEmpty() );

Expand Down

0 comments on commit b3e4c28

Please sign in to comment.