Skip to content
Permalink
Browse files

Add an additional test for cached mode of sqlite_fetch_and_increment

  • Loading branch information
m-kuhn committed Jan 10, 2019
1 parent d3b4c7d commit dafb16654fd48298a8686591ef0a7b6d799a6af2
Showing with 21 additions and 1 deletion.
  1. +21 −1 tests/src/core/testqgsexpression.cpp
@@ -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 );
}

};

0 comments on commit dafb166

Please sign in to comment.
You can’t perform that action at this time.