Skip to content

Commit

Permalink
add test to control that AllStyleCategories is actually complete
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and nyalldawson committed Sep 14, 2018
1 parent c43081b commit 20a70ee
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/src/core/testqgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class TestQgsMapLayer : public QObject
void layerRef();
void layerRefListUtils();

void styleCategories();


private:
QgsVectorLayer *mpLayer = nullptr;
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 20a70ee

Please sign in to comment.