Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add gui test for map layer datatype
  • Loading branch information
alexbruy committed Mar 15, 2020
1 parent 0e652a1 commit 2df995f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/src/gui/testprocessinggui.cpp
Expand Up @@ -3984,6 +3984,24 @@ void TestProcessingGui::mapLayerComboBox()
combo.reset();
param.reset();

// map layer param, only point vector and raster types are acceptable
param = qgis::make_unique< QgsProcessingParameterMapLayer> ( QStringLiteral( "param" ), QString(), QVariant(), false, QList< int > << QgsProcessing::TypeVectorPoint << QgsProcessing::TypeRaster );
combo = qgis::make_unique< QgsProcessingMapLayerComboBox >( param.get() );
combo->setLayer( point );
QCOMPARE( combo->currentLayer(), point );
combo->setLayer( line );
QVERIFY( !combo->currentLayer() );
combo->setLayer( polygon );
QVERIFY( !combo->currentLayer() );
combo->setLayer( noGeom );
QVERIFY( !combo->currentLayer() );
combo->setLayer( mesh );
QVERIFY( !combo->currentLayer() );
combo->setLayer( raster );
QCOMPARE( combo->currentLayer(), raster );
combo.reset();
param.reset();

// raster layer param, only raster types are acceptable
param = qgis::make_unique< QgsProcessingParameterRasterLayer> ( QStringLiteral( "param" ), QString() );
combo = qgis::make_unique< QgsProcessingMapLayerComboBox >( param.get() );
Expand Down

0 comments on commit 2df995f

Please sign in to comment.