test_dlopen.py 文件源码

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

项目:SwiftKitten 作者: johncsnyder 项目源码 文件源码
def test_struct_included():
    baseffi = FFI()
    baseffi.cdef("struct foo_s { int x; };")
    baseffi.set_source('test_struct_included_base', None)
    #
    ffi = FFI()
    ffi.include(baseffi)
    target = udir.join('test_struct_included.py')
    make_py_source(ffi, 'test_struct_included', str(target))
    assert target.read() == r"""# auto-generated file
import _cffi_backend
from test_struct_included_base import ffi as _ffi0

ffi = _cffi_backend.FFI('test_struct_included',
    _version = 0x2601,
    _types = b'\x00\x00\x00\x09',
    _struct_unions = ((b'\x00\x00\x00\x00\x00\x00\x00\x08foo_s',),),
    _includes = (_ffi0,),
)
"""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号