Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/python_testing/modebase_cluster_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def check_tags_in_lists(self, supported_modes, required_tags=None):

This function evaluates the ModeTags of each ModeOptionStruct:
- Should have at least one tag.
- There are no duplicates in ModeTag list.
- Should be maximum 16bits in size.
- Should be a Mfg tag or one of the supported ones (either common or specific).
- Should have at least one common or specific tag.
Expand All @@ -110,7 +111,12 @@ def check_tags_in_lists(self, supported_modes, required_tags=None):
if len(mode_option_struct.modeTags) == 0:
asserts.fail("The ModeTags field should have at least one entry.")

# Check each ModelTag
# There are no duplicates
tag_values = [tag.value for tag in mode_option_struct.modeTags]
if len(tag_values) != len(set(tag_values)):
asserts.fail(f"ModeTags contain duplicates in mode {mode_option_struct.mode}: {tag_values}.")

# Check each ModeTag
at_least_one_common_or_derived = False
for tag in mode_option_struct.modeTags:
# Value should not larger than 16bits
Expand Down
Loading