summaryrefslogtreecommitdiff
path: root/testing/cffi0
diff options
context:
space:
mode:
authorguillaumesottas <guillaumesottas@Guillaumes-MacBook-Pro.local>2019-03-25 10:24:53 -0600
committerguillaumesottas <guillaumesottas@Guillaumes-MacBook-Pro.local>2019-03-25 10:24:53 -0600
commit21e166d3a7641bda5821f23c3d6cc349585d1697 (patch)
tree770aaee75b05efe84b733a88843dfecd423ece63 /testing/cffi0
parent79ec6591d4bfd8e440729a705496ff645a055576 (diff)
downloadcffi-21e166d3a7641bda5821f23c3d6cc349585d1697.tar.gz
fix #407 add support for u/U suffix in integer constants (eg. 0xABu, or 0xCDU).
Diffstat (limited to 'testing/cffi0')
-rw-r--r--testing/cffi0/test_parsing.py7
1 files changed, 7 insertions, 0 deletions
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) == ('<cdef source string>:1: unexpected <FuncDef>: '
'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};""")