@@ -142,17 +142,29 @@ void TestQgsVectorLayerFeaturePool::changeGeometry()
142
142
feat.setGeometry ( QgsGeometry::fromWkt ( QStringLiteral ( " Polygon((100 100, 110 100, 110 110, 100 110, 100 100))" ) ) );
143
143
vl->updateFeature ( feat );
144
144
145
- // No features in the AOI
145
+ // Still working on the cached data
146
146
QgsFeatureIds ids3 = pool.getIntersects ( QgsRectangle ( 0 , 0 , 10 , 10 ) );
147
- QCOMPARE ( ids3.size (), 0 );
147
+ QCOMPARE ( ids3.size (), 1 );
148
+
149
+ // Repopulate the cache
150
+ QgsFeatureIds ids4 = pool.getFeatures ( QgsFeatureRequest ().setFilterRect ( QgsRectangle ( 0 , 0 , 10 , 10 ) ) );
151
+ QCOMPARE ( ids4.size (), 0 );
152
+
153
+ // Still working on the cached data
154
+ QgsFeatureIds ids5 = pool.getIntersects ( QgsRectangle ( 0 , 0 , 10 , 10 ) );
155
+ QCOMPARE ( ids5.size (), 0 );
148
156
149
157
// Update a feature to be inside the AOI
150
158
feat.setGeometry ( QgsGeometry::fromWkt ( QStringLiteral ( " Polygon((0 0, 10 0, 10 10, 0 10, 0 0))" ) ) );
151
159
vl->updateFeature ( feat );
152
160
153
- // One there again
154
- QgsFeatureIds ids4 = pool.getIntersects ( QgsRectangle ( 0 , 0 , 10 , 10 ) );
155
- QCOMPARE ( ids4.size (), 1 );
161
+ // Still cached
162
+ QgsFeatureIds ids6 = pool.getIntersects ( QgsRectangle ( 0 , 0 , 10 , 10 ) );
163
+ QCOMPARE ( ids6.size (), 0 );
164
+
165
+ // One in there again
166
+ QgsFeatureIds ids7 = pool.getFeatures ( QgsFeatureRequest ().setFilterRect ( QgsRectangle ( 0 , 0 , 10 , 10 ) ) );
167
+ QCOMPARE ( ids7.size (), 1 );
156
168
}
157
169
158
170
std::unique_ptr<QgsVectorLayer> TestQgsVectorLayerFeaturePool::createPopulatedLayer ()
0 commit comments