Skip to content
Permalink
Browse files

add gui test for map layer datatype

  • Loading branch information
alexbruy committed Mar 15, 2020
1 parent 0e652a1 commit 2df995f42ee3f8be02da7c0d4edb692cad02d27f
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/src/gui/testprocessinggui.cpp
@@ -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() );

0 comments on commit 2df995f

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