diff options
| author | Armin Rigo <arigo@tunes.org> | 2012-07-27 17:04:01 +0200 |
|---|---|---|
| committer | Armin Rigo <arigo@tunes.org> | 2012-07-27 17:04:01 +0200 |
| commit | c5fd4f707e96e599f59c05977b53a820e58c714d (patch) | |
| tree | a721a05f9b709bb71e07013cd1d843a5090b3a6d /testing | |
| parent | 09670b1f1db5f2262d1d09b810fefae62e7a1f1d (diff) | |
| download | cffi-c5fd4f707e96e599f59c05977b53a820e58c714d.tar.gz | |
Fix issue16: anonymous enums.
Diffstat (limited to 'testing')
| -rw-r--r-- | testing/backend_tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testing/backend_tests.py b/testing/backend_tests.py index faecf02..997ed19 100644 --- a/testing/backend_tests.py +++ b/testing/backend_tests.py @@ -1179,3 +1179,11 @@ class BackendTests: assert ffi1.typeof("enum foo") is not ffi2.typeof("enum foo") # sanity check: twice 'ffi1' assert ffi1.typeof("struct foo*") is ffi1.typeof("struct foo *") + + def test_anonymous_enum(self): + ffi = FFI(backend=self.Backend()) + ffi.cdef("typedef enum { Value0 = 0 } e, *pe;\n" + "typedef enum { Value1 = 1 } e1;") + assert ffi.getctype("e*") == 'enum $1 *' + assert ffi.getctype("pe") == 'enum $1 *' + assert ffi.getctype("e1*") == 'enum $2 *' |
