mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix test that checked an exception from QgsSpatialIndex constructor
This commit is contained in:
parent
914cefff95
commit
819ae6f31a
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user