Skip to content

Commit

Permalink
Fix test that checked an exception from QgsSpatialIndex constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed May 9, 2018
1 parent 914ceff commit 819ae6f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/src/analysis/testqgsprocessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 819ae6f

Please sign in to comment.