[pypy-commit] cffi cffi-1.0: extra test

arigo noreply at buildbot.pypy.org
Sat May 16 12:24:49 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r2012:0f6c34539415
Date: 2015-05-16 12:23 +0200
http://bitbucket.org/cffi/cffi/changeset/0f6c34539415/

Log:	extra test

diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py
--- a/testing/cffi1/test_re_python.py
+++ b/testing/cffi1/test_re_python.py
@@ -9,6 +9,8 @@
     SRC = """
     #define FOOBAR (-42)
     static const int FOOBAZ = -43;
+    #define BIGPOS 420000000000L
+    #define BIGNEG -420000000000L
     int add42(int x) { return x + 42; }
     struct foo_s;
     typedef struct bar_s { int x; signed char a[]; } bar_t;
@@ -27,6 +29,8 @@
     ffi.cdef("""
     #define FOOBAR -42
     static const int FOOBAZ = -43;
+    #define BIGPOS 420000000000L
+    #define BIGNEG -420000000000L
     int add42(int);
     struct foo_s;
     typedef struct bar_s { int x; signed char a[]; } bar_t;
@@ -44,6 +48,11 @@
     assert ffi.integer_const('FOOBAR') == -42
     assert ffi.integer_const('FOOBAZ') == -43
 
+def test_large_constant():
+    from re_python_pysrc import ffi
+    assert ffi.integer_const('BIGPOS') == 420000000000
+    assert ffi.integer_const('BIGNEG') == -420000000000
+
 def test_function():
     from re_python_pysrc import ffi
     lib = ffi.dlopen(extmod)


More information about the pypy-commit mailing list