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