diff options
author | Armin Rigo <arigo@tunes.org> | 2016-04-19 11:07:01 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-04-19 11:07:01 +0200 |
commit | c3e967e2581f2bb57e48fad4d9c45966ec2fcd6c (patch) | |
tree | d7c6cdcefde58e7e8195964337a09346c986c833 | |
parent | Update to cffi/eeef3869b994 (diff) | |
download | pypy-c3e967e2581f2bb57e48fad4d9c45966ec2fcd6c.tar.gz pypy-c3e967e2581f2bb57e48fad4d9c45966ec2fcd6c.tar.bz2 pypy-c3e967e2581f2bb57e48fad4d9c45966ec2fcd6c.zip |
import this too
-rw-r--r-- | pypy/module/test_lib_pypy/cffi_tests/cffi1/test_recompiler.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_recompiler.py b/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_recompiler.py index afaf12c654..0b09aefd90 100644 --- a/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_recompiler.py +++ b/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_recompiler.py @@ -417,8 +417,11 @@ def test_open_array_in_struct(): def test_math_sin_type(): ffi = FFI() - ffi.cdef("double sin(double);") - lib = verify(ffi, 'test_math_sin_type', '#include <math.h>') + ffi.cdef("double sin(double); void *xxtestfunc();") + lib = verify(ffi, 'test_math_sin_type', """ + #include <math.h> + void *xxtestfunc(void) { return 0; } + """) # 'lib.sin' is typed as a <built-in method> object on lib assert ffi.typeof(lib.sin).cname == "double(*)(double)" # 'x' is another <built-in method> object on lib, made very indirectly @@ -428,7 +431,16 @@ def test_math_sin_type(): # present on built-in functions on CPython; must be emulated on PyPy: assert lib.sin.__name__ == 'sin' assert lib.sin.__module__ == '_CFFI_test_math_sin_type' - assert lib.sin.__doc__ == 'direct call to the C function of the same name' + assert lib.sin.__doc__ == ( + "double sin(double);\n" + "\n" + "CFFI C function from _CFFI_test_math_sin_type.lib") + + assert ffi.typeof(lib.xxtestfunc).cname == "void *(*)()" + assert lib.xxtestfunc.__doc__ == ( + "void *xxtestfunc();\n" + "\n" + "CFFI C function from _CFFI_test_math_sin_type.lib") def test_verify_anonymous_struct_with_typedef(): ffi = FFI() |