From 819ae6f31a09f2e81af19418bad8d997c59fe410 Mon Sep 17 00:00:00 2001 From: Martin Dobias Date: Tue, 8 May 2018 17:06:03 -0400 Subject: [PATCH] Fix test that checked an exception from QgsSpatialIndex constructor --- tests/src/analysis/testqgsprocessing.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index 888ed639073..8e8c3a46b06 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/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() ); // create selection layer->selectByIds( QgsFeatureIds() << 4 << 5 );