From 21e166d3a7641bda5821f23c3d6cc349585d1697 Mon Sep 17 00:00:00 2001 From: guillaumesottas Date: Mon, 25 Mar 2019 10:24:53 -0600 Subject: fix #407 add support for u/U suffix in integer constants (eg. 0xABu, or 0xCDU). --- testing/cffi0/test_parsing.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testing/cffi0') diff --git a/testing/cffi0/test_parsing.py b/testing/cffi0/test_parsing.py index 2d75850..c06c4b6 100644 --- a/testing/cffi0/test_parsing.py +++ b/testing/cffi0/test_parsing.py @@ -466,3 +466,10 @@ def test_error_invalid_syntax_for_cdef(): e = py.test.raises(CDefError, ffi.cdef, 'void foo(void) {}') assert str(e.value) == (':1: unexpected : ' 'this construct is valid C but not valid in cdef()') + +def test_unsigned_int_suffix_for_constant(): + ffi = FFI() + ffi.cdef("""enum e { + enumerator_0=0x00, + enumerator_1=0x01u, + enumerator_1=0x01U};""") -- cgit v1.2.1