Skip to content
Permalink
Browse files

Fix test linking

  • Loading branch information
m-kuhn committed Jan 10, 2019
1 parent a740fec commit ccdd133c8bd84658532bf0d44606439b06bfac4a
Showing with 6 additions and 6 deletions.
  1. +6 −6 tests/src/core/testqgsexpression.cpp
@@ -3320,40 +3320,40 @@ class TestQgsExpression: public QObject

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

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

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

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 );
QCOMPARE( feature3.attribute( "T_Id" ).toInt(), 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 );
QCOMPARE( feature4.attribute( "T_Id" ).toInt(), 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 );
QCOMPARE( zustaendigkeitskataster->dataProvider()->featureCount(), 4l );
}

};

0 comments on commit ccdd133

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