Author: Ronan Lamy <[email protected]>
Branch: hpy
Changeset: r98074:01381639f0d0
Date: 2019-11-16 16:45 +0100
http://bitbucket.org/pypy/pypy/changeset/01381639f0d0/
Log: Add a cparser test
diff --git a/pypy/module/cpyext/test/test_cparser.py
b/pypy/module/cpyext/test/test_cparser.py
--- a/pypy/module/cpyext/test/test_cparser.py
+++ b/pypy/module/cpyext/test/test_cparser.py
@@ -118,6 +118,17 @@
Object = cts.gettype('Object')
assert isinstance(Object, lltype.Struct)
+def test_incomplete_struct():
+ cdef = """
+ typedef struct s *ptr;
+ struct s {void* x;};
+ typedef struct s __s; // HACK!
+ """
+ cts = parse_source(cdef)
+ PTR = cts.gettype("ptr")
+ assert isinstance(PTR.TO, lltype.Struct)
+ hash(PTR)
+
def test_recursive():
cdef = """
typedef ssize_t Py_ssize_t;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit