[pypy-commit] pypy hpy: Add a cparser test

rlamy pypy.commits at gmail.com
Sat Nov 16 11:01:53 EST 2019


Author: Ronan Lamy <ronan.lamy at gmail.com>
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;


More information about the pypy-commit mailing list