def test_enum(): from re_python_pysrc import ffi assert ffi.integer_const("BB") == 1 e = ffi.cast("enum foo_e", 2) assert ffi.string(e) == "CC"
def test_function_with_varargs(): import _cffi_backend from re_python_pysrc import ffi lib = ffi.dlopen(extmod, 0) assert lib.add43(45, ffi.cast("int", -5)) == 45 assert type(lib.add43) is _cffi_backend.FFI.CData
def test_opaque_struct(): from re_python_pysrc import ffi ffi.cast("struct foo_s *", 0) py.test.raises(TypeError, ffi.new, "struct foo_s *")
def test_enum(self): self.fix_path() from re_python_pysrc import ffi assert ffi.integer_const("BB") == 1 e = ffi.cast("enum foo_e", 2) assert ffi.string(e) == "CC"
def test_opaque_struct(self): self.fix_path() from re_python_pysrc import ffi ffi.cast("struct foo_s *", 0) raises(TypeError, ffi.new, "struct foo_s *")