Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ctypes import Structure, c_int16
- def test_struct_format():
- class Struct(Structure):
- _fields_ = [('a', c_int16)]
- Struct3 = 3 * Struct
- c_array = (2 * Struct3)(
- Struct3(Struct(a=1), Struct(a=2), Struct(a=3)),
- Struct3(Struct(a=4), Struct(a=5), Struct(a=6))
- )
- mv = memoryview(c_array)
- assert mv.format == 'T{<h:a:}', '%s != "T{<h:a:}"' % mv.format
- test_struct_format()
Add Comment
Please, Sign In to add comment