Skip to content
Permalink
Browse files

add test to control that AllStyleCategories is actually complete

  • Loading branch information
3nids authored and nyalldawson committed Sep 14, 2018
1 parent c43081b commit 20a70eea25d0b5895f68232feb6e3fed4a2b8e48
Showing with 14 additions and 1 deletion.
  1. +14 −1 tests/src/core/testqgsmaplayer.cpp
@@ -73,6 +73,8 @@ class TestQgsMapLayer : public QObject
void layerRef();
void layerRefListUtils();

void styleCategories();


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


void TestQgsMapLayer::styleCategories()
{
// control that AllStyleCategories is actually complete
QgsMapLayer::StyleCategories allStyleCategories = QgsMapLayer::AllCategories;
for ( QgsMapLayer::StyleCategory category : qgsEnumMap<QgsMapLayer::StyleCategory>().keys() )
{
if ( category == QgsMapLayer::AllCategories )
continue;

QVERIFY( allStyleCategories.testFlag( category ) );
}
}

QGSTEST_MAIN( TestQgsMapLayer )

0 comments on commit 20a70ee

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