Skip to content
Permalink
Browse files

Fix test that checked an exception from QgsSpatialIndex constructor

  • Loading branch information
wonder-sk committed May 8, 2018
1 parent 914ceff commit 819ae6f31a09f2e81af19418bad8d997c59fe410
Showing with 3 additions and 11 deletions.
  1. +3 −11 tests/src/analysis/testqgsprocessing.cpp
@@ -1371,17 +1371,9 @@ void TestQgsProcessing::createIndex()
// selected features check, but none selected
params.insert( QStringLiteral( "layer" ), QVariant::fromValue( QgsProcessingFeatureSourceDefinition( layer->id(), true ) ) );
source.reset( QgsProcessingParameters::parameterAsSource( def.get(), params, context ) );
bool caught = false;
try
{
index = QgsSpatialIndex( *source );
ids = index.nearestNeighbor( QgsPointXY( 2.1, 2 ), 1 );
}
catch ( ... )
{
caught = true;
}
QVERIFY( caught );
index = QgsSpatialIndex( *source );
ids = index.nearestNeighbor( QgsPointXY( 2.1, 2 ), 1 );
QCOMPARE( ids, QList<QgsFeatureId>() );

// create selection
layer->selectByIds( QgsFeatureIds() << 4 << 5 );

0 comments on commit 819ae6f

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