Skip to content
Permalink
Browse files

Fix identify action test

  • Loading branch information
nirvn committed Nov 9, 2020
1 parent aa90eb7 commit 06ed78e766671fc5f7f0769dbf17513b86ccd796
Showing with 13 additions and 3 deletions.
  1. +13 −3 tests/src/app/testqgsmaptoolidentifyaction.cpp
@@ -531,7 +531,11 @@ QList<QgsMapToolIdentify::IdentifyResult> TestQgsMapToolIdentifyAction::testIden
{
std::unique_ptr< QgsMapToolIdentifyAction > action( new QgsMapToolIdentifyAction( canvas ) );
QgsPointXY mapPoint = canvas->getCoordinateTransform()->transform( xGeoref, yGeoref );
QList<QgsMapToolIdentify::IdentifyResult> result = action->identify( mapPoint.x(), mapPoint.y(), QList<QgsMapLayer *>() << layer );
//check that closest point attributes are present
QgsIdentifyContext identifyContext;
if ( canvas->mapSettings().isTemporal() )
identifyContext.setTemporalRange( canvas->temporalRange() );
QList<QgsMapToolIdentify::IdentifyResult> result = action->identify( mapPoint.x(), mapPoint.y(), QList<QgsMapLayer *>() << layer, QgsMapToolIdentify::DefaultQgsSetting, identifyContext );
return result;
}

@@ -541,7 +545,10 @@ TestQgsMapToolIdentifyAction::testIdentifyVector( QgsVectorLayer *layer, double
{
std::unique_ptr< QgsMapToolIdentifyAction > action( new QgsMapToolIdentifyAction( canvas ) );
QgsPointXY mapPoint = canvas->getCoordinateTransform()->transform( xGeoref, yGeoref );
QList<QgsMapToolIdentify::IdentifyResult> result = action->identify( mapPoint.x(), mapPoint.y(), QList<QgsMapLayer *>() << layer );
QgsIdentifyContext identifyContext;
if ( canvas->mapSettings().isTemporal() )
identifyContext.setTemporalRange( canvas->temporalRange() );
QList<QgsMapToolIdentify::IdentifyResult> result = action->identify( mapPoint.x(), mapPoint.y(), QList<QgsMapLayer *>() << layer, QgsMapToolIdentify::DefaultQgsSetting, identifyContext );
return result;
}

@@ -551,7 +558,10 @@ TestQgsMapToolIdentifyAction::testIdentifyVectorTile( QgsVectorTileLayer *layer,
{
std::unique_ptr< QgsMapToolIdentifyAction > action( new QgsMapToolIdentifyAction( canvas ) );
QgsPointXY mapPoint = canvas->getCoordinateTransform()->transform( xGeoref, yGeoref );
QList<QgsMapToolIdentify::IdentifyResult> result = action->identify( mapPoint.x(), mapPoint.y(), QList<QgsMapLayer *>() << layer );
QgsIdentifyContext identifyContext;
if ( canvas->mapSettings().isTemporal() )
identifyContext.setTemporalRange( canvas->temporalRange() );
QList<QgsMapToolIdentify::IdentifyResult> result = action->identify( mapPoint.x(), mapPoint.y(), QList<QgsMapLayer *>() << layer, QgsMapToolIdentify::DefaultQgsSetting, identifyContext );
return result;
}

0 comments on commit 06ed78e

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