Skip to content

Commit b602b4d

Browse files
committed
Merge branch 'test-36' into 'master'
Add test case for issue #36. See merge request inducer/pycparserext!1
2 parents 6aaa214 + e635228 commit b602b4d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/test_pycparserext.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,24 @@ def test_no_added_attr():
357357
assert "attr" not in gen.visit(ast)
358358

359359

360+
def test_double_pointer():
361+
src = """
362+
typedef struct Error {
363+
int dummy;
364+
} Error;
365+
366+
void func_with_p2pp(const char *, Error **);
367+
"""
368+
import pycparserext.ext_c_parser as ext_c_parser
369+
import pycparserext.ext_c_generator as ext_c_generator
370+
371+
parser = ext_c_parser.GnuCParser()
372+
ast = parser.parse(src)
373+
gen = ext_c_generator.GnuCGenerator()
374+
ast.show()
375+
assert gen.visit(ast).find("func_with_p2pp(const char *, Error **)") != -1
376+
377+
360378
if __name__ == "__main__":
361379
import sys
362380
if len(sys.argv) > 1:

0 commit comments

Comments
 (0)