Add opaque StructType;

Remove test/typehandle.py;
Add test/opaque.py to demonstrate recursive type.
This commit is contained in:
Siu Kwan Lam 2012-07-22 15:14:52 -07:00
commit c9902ab8cf
9 changed files with 171 additions and 80 deletions

View file

@ -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")