Skip to content

Commit 20a70ee

Browse files
3nidsnyalldawson
authored andcommittedSep 14, 2018
add test to control that AllStyleCategories is actually complete
1 parent c43081b commit 20a70ee

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

‎tests/src/core/testqgsmaplayer.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class TestQgsMapLayer : public QObject
7373
void layerRef();
7474
void layerRefListUtils();
7575

76+
void styleCategories();
77+
7678

7779
private:
7880
QgsVectorLayer *mpLayer = nullptr;
@@ -283,8 +285,19 @@ void TestQgsMapLayer::layerRefListUtils()
283285
QCOMPARE( refs.size(), 2 );
284286
QCOMPARE( refs.at( 0 ).get(), vlA );
285287
QCOMPARE( refs.at( 1 ).get(), vlC );
288+
}
286289

287-
290+
void TestQgsMapLayer::styleCategories()
291+
{
292+
// control that AllStyleCategories is actually complete
293+
QgsMapLayer::StyleCategories allStyleCategories = QgsMapLayer::AllCategories;
294+
for ( QgsMapLayer::StyleCategory category : qgsEnumMap<QgsMapLayer::StyleCategory>().keys() )
295+
{
296+
if ( category == QgsMapLayer::AllCategories )
297+
continue;
298+
299+
QVERIFY( allStyleCategories.testFlag( category ) );
300+
}
288301
}
289302

290303
QGSTEST_MAIN( TestQgsMapLayer )

0 commit comments

Comments
 (0)
Please sign in to comment.