Add opaque StructType;
Remove test/typehandle.py; Add test/opaque.py to demonstrate recursive type.
This commit is contained in:
parent
b71d22b570
commit
c9902ab8cf
9 changed files with 171 additions and 80 deletions
19
test/test.py
19
test/test.py
|
|
@ -67,6 +67,25 @@ class TestModule(unittest.TestCase):
|
|||
for elty in struct.elements:
|
||||
self.assertEqual(elty, Type.int())
|
||||
|
||||
# rename identified type
|
||||
struct.name = 'new_name'
|
||||
self.assertEqual(struct.name, 'new_name')
|
||||
self.assertIs(m.get_type_named("struct.two.int"), None)
|
||||
|
||||
self.assertEqual(got_struct.name, struct.name)
|
||||
|
||||
# remove identified type
|
||||
struct.name = ''
|
||||
|
||||
self.assertIs(m.get_type_named("struct.two.int"), None)
|
||||
self.assertIs(m.get_type_named("new_name"), None)
|
||||
|
||||
# another name
|
||||
|
||||
struct.name = 'another.name'
|
||||
self.assertEqual(struct.name, 'another.name')
|
||||
self.assertEqual(got_struct.name, struct.name)
|
||||
|
||||
def testglobal_variable(self):
|
||||
"""Global variables."""
|
||||
m = Module.new("test5.1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue