def test_to_ctypes(self):
for seq, dtype in ((singlebyteseq, ctypes.c_ubyte),
(singlebytebuf, ctypes.c_ubyte),
(doublebyteseq, ctypes.c_ushort),
(doublebytebuf, ctypes.c_ushort),
(quadbyteseq, ctypes.c_uint),
(quadbytebuf, ctypes.c_uint)):
bytebuf, size = sdlextarray.to_ctypes(seq, dtype)
self.assertEqual(size, len(seq))
for index, x in enumerate(bytebuf):
self.assertEqual(x, seq[index])
sdl2ext_array_test.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录