[pypy-commit] cffi default: Add a passing test

arigo noreply at buildbot.pypy.org
Thu May 28 13:20:57 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2120:e1598160e2e1
Date: 2015-05-28 13:21 +0200
http://bitbucket.org/cffi/cffi/changeset/e1598160e2e1/

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
@@ -841,3 +841,12 @@
     assert lib.toint(lib.CONSTANT) == 42
     random_stuff()
     assert lib.toint(lib.CONSTANT) == 42
+
+def test_constant_is_not_a_compiler_constant():
+    ffi = FFI()
+    ffi.cdef("static const float almost_forty_two;")
+    lib = verify(ffi, 'test_constant_is_not_a_compiler_constant', """
+        static float f(void) { return 42.25; }
+        #define almost_forty_two (f())
+    """)
+    assert lib.almost_forty_two == 42.25


More information about the pypy-commit mailing list