Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2128:0b1191b8d73d
Date: 2015-05-28 22:20 +0200
http://bitbucket.org/cffi/cffi/changeset/0b1191b8d73d/
Log: add a passing test
diff --git a/testing/cffi1/test_dlopen.py b/testing/cffi1/test_dlopen.py
--- a/testing/cffi1/test_dlopen.py
+++ b/testing/cffi1/test_dlopen.py
@@ -208,3 +208,18 @@
_globals = (b'\x00\x00\x00\x21myglob',0,),
)
"""
+
+def test_bitfield():
+ ffi = FFI()
+ ffi.cdef("struct foo_s { int y:10; short x:5; };")
+ target = udir.join('test_bitfield.py')
+ make_py_source(ffi, 'test_bitfield', str(target))
+ assert target.read() == r"""# auto-generated file
+import _cffi_backend
+
+ffi = _cffi_backend.FFI('test_bitfield',
+ _version = 0x2601,
+ _types = b'\x00\x00\x07\x01\x00\x00\x05\x01\x00\x00\x00\x09',
+ _struct_unions =
((b'\x00\x00\x00\x02\x00\x00\x00\x02foo_s',b'\x00\x00\x00\x13\x00\x00\x00\x0Ay',b'\x00\x00\x01\x13\x00\x00\x00\x05x'),),
+)
+"""
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit