Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2123:4f05d11fa6ab
Date: 2015-05-28 16:34 +0200
http://bitbucket.org/cffi/cffi/changeset/4f05d11fa6ab/
Log: Add a passing test
diff --git a/testing/cffi1/test_recompiler.py b/testing/cffi1/test_recompiler.py
--- a/testing/cffi1/test_recompiler.py
+++ b/testing/cffi1/test_recompiler.py
@@ -881,3 +881,14 @@
p = ffi.addressof(lib, 'globvar')
assert ffi.typeof(p) == ffi.typeof('opaque_t *')
assert ffi.string(ffi.cast("char *", p), 8) == "hello"
+
+def test_constant_of_value_unknown_to_the_compiler():
+ extra_c_source = udir.join(
+ 'extra_test_constant_of_value_unknown_to_the_compiler.c')
+ extra_c_source.write('const int external_foo = 42;\n')
+ ffi = FFI()
+ ffi.cdef("const int external_foo;")
+ lib = verify(ffi, 'test_constant_of_value_unknown_to_the_compiler', """
+ extern const int external_foo;
+ """, sources=[str(extra_c_source)])
+ assert lib.external_foo == 42
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit