class test(pstruct.type): _fields_ = [ (pint.uint32_t, 'u32'), (pint.uint8_t, 'u8'), (dynamic.align(4), 'alignment'), (pint.uint32_t, 'end'), ]
def test_dynamic_alignment_double_negative(): t = dynamic.align(-8) a = t(offset=-0x100).a if a.size() == 0: raise Success
def test_dynamic_alignment_negative_offset(): t = dynamic.align(8) a = t(offset=-0x41).a if a.size() == 1: raise Success
def test_dynamic_alignment_noparent_nonzero(): t = dynamic.align(0x10) a = t(offset=4).a if a.size() == 0xc: raise Success
def test_dynamic_alignment_noparent_zero(): t = dynamic.align(0x10) a = t().a if a.size() == 0: raise Success
class test(pstruct.type): _fields_ = [ (pint.uint8_t, 'a'), (dynamic.align(8), 'b'), ]