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
|
// selected features check, but none selected
|
||||||
params.insert( QStringLiteral( "layer" ), QVariant::fromValue( QgsProcessingFeatureSourceDefinition( layer->id(), true ) ) );
|
params.insert( QStringLiteral( "layer" ), QVariant::fromValue( QgsProcessingFeatureSourceDefinition( layer->id(), true ) ) );
|
||||||
source.reset( QgsProcessingParameters::parameterAsSource( def.get(), params, context ) );
|
source.reset( QgsProcessingParameters::parameterAsSource( def.get(), params, context ) );
|
||||||
bool caught = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
index = QgsSpatialIndex( *source );
|
index = QgsSpatialIndex( *source );
|
||||||
ids = index.nearestNeighbor( QgsPointXY( 2.1, 2 ), 1 );
|
ids = index.nearestNeighbor( QgsPointXY( 2.1, 2 ), 1 );
|
||||||
}
|
QCOMPARE( ids, QList<QgsFeatureId>() );
|
||||||
catch ( ... )
|
|
||||||
{
|
|
||||||
caught = true;
|
|
||||||
}
|
|
||||||
QVERIFY( caught );
|
|
||||||
|
|
||||||
// create selection
|
// create selection
|
||||||
layer->selectByIds( QgsFeatureIds() << 4 << 5 );
|
layer->selectByIds( QgsFeatureIds() << 4 << 5 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user