Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r77661:f034bc159fa5
Date: 2015-05-28 19:21 +0200
http://bitbucket.org/pypy/pypy/changeset/f034bc159fa5/

Log:    add a passing test (cffi/020ef1915196)

diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py 
b/pypy/module/_cffi_backend/test/test_recompiler.py
--- a/pypy/module/_cffi_backend/test/test_recompiler.py
+++ b/pypy/module/_cffi_backend/test/test_recompiler.py
@@ -868,3 +868,18 @@
             "extern const int external_foo;",
             extra_source=extra_c_source)
         assert lib.external_foo == 42
+
+    def test_call_with_incomplete_structs(self):
+        ffi, lib = self.prepare(
+            "typedef struct {...;} foo_t; "
+            "foo_t myglob; "
+            "foo_t increment(foo_t s); "
+            "double getx(foo_t s);",
+            'test_call_with_incomplete_structs', """
+            typedef double foo_t;
+            double myglob = 42.5;
+            double getx(double x) { return x; }
+            double increment(double x) { return x + 1; }
+        """)
+        assert lib.getx(lib.myglob) == 42.5
+        assert lib.getx(lib.increment(lib.myglob)) == 43.5
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to