diff options
author | Armin Rigo <arigo@tunes.org> | 2022-07-18 15:55:46 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2022-07-18 15:55:46 +0200 |
commit | f0a33ae0ce2e62eb3a625c7baef175f385328b17 (patch) | |
tree | a7ad2efb5518473f36d97d8d92c4a3894f3d602d /testing/cffi0 | |
parent | d19553253e3c2967238777b4005abb5dc57f656d (diff) | |
download | cffi-f0a33ae0ce2e62eb3a625c7baef175f385328b17.tar.gz |
Tentative fix for issue #542
Diffstat (limited to 'testing/cffi0')
-rw-r--r-- | testing/cffi0/test_model.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/testing/cffi0/test_model.py b/testing/cffi0/test_model.py index bb653ca..328ba2d 100644 --- a/testing/cffi0/test_model.py +++ b/testing/cffi0/test_model.py @@ -54,8 +54,17 @@ def test_const_pointer_type(): ptr_type = ConstPointerType(PrimitiveType("int")) assert ptr_type.get_c_name("x") == "int const * x" ptr_type = ConstPointerType(ArrayType(PrimitiveType("int"), 5)) - assert ptr_type.get_c_name("") == "int(const *)[5]" - assert ptr_type.get_c_name("*x") == "int(const * *x)[5]" + assert ptr_type.get_c_name("") == "int const (*)[5]" + assert ptr_type.get_c_name("*x") == "int const (* *x)[5]" + ptr_type = ConstPointerType(ArrayType( + ConstPointerType(PrimitiveType("int")), 5)) + assert ptr_type.get_c_name("x") == "int const * const (* x)[5]" + ptr_type = PointerType(ArrayType( + ConstPointerType(PrimitiveType("int")), 5)) + assert ptr_type.get_c_name("x") == "int const *(* x)[5]" + ptr_type = ConstPointerType(ArrayType( + PointerType(PrimitiveType("int")), 5)) + assert ptr_type.get_c_name("x") == "int * const (* x)[5]" def test_qual_pointer_type(): ptr_type = PointerType(PrimitiveType("long long"), Q_RESTRICT) |