Skip to content

Commit d8da4b8

Browse files
committedAug 8, 2015
Followup 71e7aab, add unit tests
1 parent ce0eb2b commit d8da4b8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
 

‎tests/src/core/testqgsvectorlayer.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ class TestQgsVectorLayer : public QObject
101101
void QgsVectorLayersetRendererV2();
102102
void QgsVectorLayersetFeatureBlendMode();
103103
void QgsVectorLayersetLayerTransparency();
104+
void uniqueValues();
105+
void minimumValue();
106+
void maximumValue();
104107
};
105108

106109
void TestQgsVectorLayer::initTestCase()
@@ -312,5 +315,31 @@ void TestQgsVectorLayer::QgsVectorLayersetLayerTransparency()
312315
QCOMPARE( vLayer->layerTransparency(), 50 );
313316
}
314317

318+
void TestQgsVectorLayer::uniqueValues()
319+
{
320+
QgsVectorLayer* vLayer = static_cast< QgsVectorLayer * >( mpPointsLayer );
321+
322+
//test with invalid field
323+
QList<QVariant> values;
324+
vLayer->uniqueValues( 1000, values );
325+
QCOMPARE( values.length(), 0 );
326+
}
327+
328+
void TestQgsVectorLayer::minimumValue()
329+
{
330+
QgsVectorLayer* vLayer = static_cast< QgsVectorLayer * >( mpPointsLayer );
331+
332+
//test with invalid field
333+
QCOMPARE( vLayer->minimumValue( 1000 ), QVariant() );
334+
}
335+
336+
void TestQgsVectorLayer::maximumValue()
337+
{
338+
QgsVectorLayer* vLayer = static_cast< QgsVectorLayer * >( mpPointsLayer );
339+
340+
//test with invalid field
341+
QCOMPARE( vLayer->maximumValue( 1000 ), QVariant() );
342+
}
343+
315344
QTEST_MAIN( TestQgsVectorLayer )
316345
#include "testqgsvectorlayer.moc"

0 commit comments

Comments
 (0)
Please sign in to comment.