Example #1
0
    def testCreateNamedStruct(self):
        ty = Type.create_named_structure(self.global_context, "mystruct")
        self.assertEqual('mystruct', ty.struct_name())

        el = Type.int8()
        ty.set_body([el, el], True)
        self.assertEqual(2, ty.num_elements())
        self.assertTrue(ty.is_packed())
Example #2
0
    def testCreateNamedStruct(self):
        ty = Type.create_named_structure(self.global_context, "mystruct")
        self.assertEqual('mystruct', ty.struct_name())

        el = Type.int8()
        ty.set_body([el, el], True)
        self.assertEqual(2, ty.num_elements())
        self.assertTrue(ty.is_packed())
Example #3
0
    def testCreateNamedStructInMod(self):
        ctx = Context()
        mod = Module.CreateWithName('mod', ctx)
        ty = Type.create_named_structure(mod.context, 'mystruct')
        el = Type.int8(context=mod.context)
        ty.set_body([el, el], True)
        t = mod.get_type('mystruct')

        self.assertEqual(ty, t)
Example #4
0
 def testCreateNamedStructInMod(self):
     ctx = Context()
     mod = Module.CreateWithName('mod', ctx)
     ty = Type.create_named_structure(mod.context,
                                      'mystruct')
     el = Type.int8(context=mod.context)
     ty.set_body([el, el], True)
     t = mod.get_type('mystruct')
     
     self.assertEqual(ty, t)