def test_multiple_independent_structs(self):
CDEF2 = "struct ab { int x; };"
ffi2 = cffi.FFI(); ffi2.cdef(CDEF2)
outputfilename = recompile(ffi2, "test_multiple_independent_structs",
CDEF2, tmpdir=str(udir))
module = imp.load_dynamic("test_multiple_independent_structs",
outputfilename)
ffi1 = module.ffi
foo1 = ffi1.new("struct ab *", [10])
foo2 = ffi .new("struct ab *", [20, 30])
assert foo1.x == 10
assert foo2.a == 20
assert foo2.b == 30
评论列表
文章目录