sdl2ext_array_test.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:inventwithpython_pysdl2 作者: rswinkle 项目源码 文件源码
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])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号