def test_load_library(self): ffi = FFI() ffi.cdef("double sin(double x);") csrc = '/*hi there %s!3*/\n#include <math.h>\n' % self v = Verifier(ffi, csrc, force_generic_engine=self.generic) library = v.load_library() assert library.sin(12.3) == math.sin(12.3)
def test_verifier_args(self): ffi = FFI() ffi.cdef("double sin(double x);") csrc = '/*hi there %s!4*/#include "test_verifier_args.h"\n' % self udir.join('test_verifier_args.h').write('#include <math.h>\n') v = Verifier(ffi, csrc, include_dirs=[str(udir)], force_generic_engine=self.generic) library = v.load_library() assert library.sin(12.3) == math.sin(12.3)
def test_verifier_args(self): ffi = FFI() ffi.cdef("double sin(double x);") csrc = '/*hi there %s!4*/#include "test_verifier_args.h"\n' % self udir.join('test_verifier_args.h').write('#include <math.h>\n') v = Verifier(ffi, csrc, include_dirs=[str(udir)], force_generic_engine=self.generic, libraries=[self.lib_m]) library = v.load_library() assert library.sin(12.3) == math.sin(12.3)