Skip to content

Commit

Permalink
Add test for sized strings in structs as well
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jan 21, 2022
1 parent af2e1ef commit 313d4ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/idl/test_matter_idl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def test_global_struct(self):
CHAR_STRING astring = 1;
optional CLUSTER_ID idlist[] = 2;
nullable int valueThatIsNullable = 0x123;
char_string<123> sized_string = 222;
}
""")

Expand All @@ -82,6 +83,7 @@ def test_global_struct(self):
[FieldAttribute.OPTIONAL])),
Field(data_type=DataType(name="int"), code=0x123, name="valueThatIsNullable", attributes=set(
[FieldAttribute.NULLABLE])),
Field(data_type=DataType(name="char_string", max_length=123), code=222, name="sized_string", attributes=set()),
])]
)
self.assertEqual(actual, expected)
Expand Down

0 comments on commit 313d4ee

Please sign in to comment.