Skip to content

Commit

Permalink
Add an additional test for cached mode of sqlite_fetch_and_increment
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 10, 2019
1 parent d3b4c7d commit dafb166
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/src/core/testqgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3332,8 +3332,28 @@ class TestQgsExpression: public QObject
zustaendigkeitskataster->addFeature( feature2 );

zustaendigkeitskataster->commitChanges();

QCOMPARE( zustaendigkeitskataster->dataProvider()->featureCount(), 2 );

QCOMPARE( zustaendigkeitskataster->editBuffer(), nullptr );
QCOMPARE( zustaendigkeitskataster->dataProvider()->transaction(), nullptr );

zustaendigkeitskataster->startEditing();
QgsExpressionContext context2( QgsExpressionContextUtils::globalProjectLayerScopes( zustaendigkeitskataster ) );
QgsFeature feature3 = QgsVectorLayerUtils::createFeature( zustaendigkeitskataster, QgsGeometry(), QgsAttributeMap(), &context );
QCOMPARE( feature3.attribute( "T_Id" ), 2 );
feature3.setAttribute( "url_behoerde", "url_behoerde" );
feature3.setAttribute( "url_kataster", "url_kataster" );
zustaendigkeitskataster->addFeature( feature3 );

QgsFeature feature4 = QgsVectorLayerUtils::createFeature( zustaendigkeitskataster, QgsGeometry(), QgsAttributeMap(), &context );
QCOMPARE( feature4.attribute( "T_Id" ), 3 );
feature4.setAttribute( "url_behoerde", "url_behoerde_x" );
feature4.setAttribute( "url_kataster", "url_kataster_x" );
zustaendigkeitskataster->addFeature( feature4 );

zustaendigkeitskataster->commitChanges();

QCOMPARE( zustaendigkeitskataster->dataProvider()->featureCount(), 4 );
}

};
Expand Down

0 comments on commit dafb166

Please sign in to comment.