Skip to content

Commit

Permalink
Test when buffer draw is deactivated
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Feb 13, 2020
1 parent 4ba55c3 commit 55fcdc7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/src/app/testqgslabelpropertydialog.cpp
Expand Up @@ -75,7 +75,7 @@ class TestQgsLabelPropertyDialog : public QObject
QgsAuxiliaryLayer::createProperty( QgsPalLayerSettings::BufferDraw, vl );
QgsPropertyDefinition def = QgsPalLayerSettings::propertyDefinitions()[QgsPalLayerSettings::BufferDraw];
QString propName = QgsAuxiliaryLayer::nameFromProperty( def, true );
QCOMPARE( al->featureCount(), 0 );
QCOMPARE( int( al->featureCount() ), 0 );

QgsFeatureId fid = 0;
QVariant val = vl->getFeature( fid ).attribute( propName );
Expand All @@ -93,9 +93,22 @@ class TestQgsLabelPropertyDialog : public QObject
}

// check auxiliary values
QCOMPARE( al->featureCount(), 1 );
QCOMPARE( int( al->featureCount() ), 1 );
val = vl->getFeature( fid ).attribute( propName );
QCOMPARE( val.toInt(), 1 );

// toggle false
dialog.bufferDrawToggled( false );

changes = dialog.changedProperties();
changeIt = changes.constBegin();
for ( ; changeIt != changes.constEnd(); ++changeIt )
{
vl->changeAttributeValue( fid, changeIt.key(), changeIt.value() );
}

val = vl->getFeature( fid ).attribute( propName );
QCOMPARE( val.toInt(), 0 );
}
};

Expand Down

0 comments on commit 55fcdc7

Please sign in to comment.