Skip to content

Commit

Permalink
Add stat enum defined test (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Oct 30, 2018
1 parent 9c40afe commit 9781df8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions meta/test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,26 @@ sub CreateSerializeUnionsTest
WriteTest "}";
}

sub CreateStatEnumTest
{
# make sure that all objects with stats are populated

DefineTestName "statenum_defined";

WriteTest "{";

for my $key (sort keys %main::SAI_ENUMS)
{
next if not $key =~ /sai_(\w+)_stat_t/;

my $ot = uc("SAI_OBJECT_TYPE_$1");

WriteTest " TEST_ASSERT_TRUE(sai_metadata_object_type_info_${ot}".".statenum != NULL, \"statenum field for object $ot must be populated\");";
}

WriteTest "}";
}

sub WriteTestHeader
{
#
Expand Down Expand Up @@ -577,6 +597,8 @@ sub CreateTests

CreateSerializeUnionsTest();

CreateStatEnumTest();

WriteTestMain();
}

Expand Down

0 comments on commit 9781df8

Please sign in to comment.