Skip to content

Commit

Permalink
Added test that should verify if #80 is fixed, will work on fixing it
Browse files Browse the repository at this point in the history
  • Loading branch information
James Johnson committed Sep 30, 2019
1 parent 8d4deaa commit 84466da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,23 @@ def test_enum_name_as_type(self):
self.assertEqual(dom.test, 1)
self.assertEqual(dom.test.enum_name, "BLAH2")

def test_enum_word_type(self):
dom = self._test_parse_build(
"\x01",
"""
enum <WORD> tagID {
M_TAG0, // should be 0
M_TAG1 = 0xff01,
M_TAG2,
M_TAG3,
};
""",
)
self.assertEqual(dom.M_TAG0.__class__.__name__, "UShort")
self.assertEqual(dom.M_TAG1.__class__.__name__, "UShort")
self.assertEqual(dom.M_TAG2.__class__.__name__, "UShort")
self.assertEqual(dom.M_TAG3.__class__.__name__, "UShort")

def test_enum_with_bitfield(self):
dom = self._test_parse_build(
"\x31",
Expand Down

0 comments on commit 84466da

Please sign in to comment.