Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1818:b5bfa871d282
Date: 2015-04-25 12:07 +0200
http://bitbucket.org/cffi/cffi/changeset/b5bfa871d282/

Log:    Add a passing test

diff --git a/testing/backend_tests.py b/testing/backend_tests.py
--- a/testing/backend_tests.py
+++ b/testing/backend_tests.py
@@ -1388,6 +1388,17 @@
         assert p.c == 14
         assert p.d == 14
 
+    def test_nested_field_offset_align(self):
+        ffi = FFI(backend=self.Backend())
+        ffi.cdef("""
+            struct foo_s {
+                struct { int a; char b; };
+                union { char c; };
+            };
+        """)
+        assert ffi.offsetof("struct foo_s", "c") == 2 * SIZE_OF_INT
+        assert ffi.sizeof("struct foo_s") == 3 * SIZE_OF_INT
+
     def test_nested_anonymous_union(self):
         ffi = FFI(backend=self.Backend())
         ffi.cdef("""
diff --git a/testing/test_ctypes.py b/testing/test_ctypes.py
--- a/testing/test_ctypes.py
+++ b/testing/test_ctypes.py
@@ -28,6 +28,9 @@
     def test_nested_anonymous_struct(self):
         py.test.skip("ctypes backend: not supported: nested anonymous struct")
 
+    def test_nested_field_offset_align(self):
+        py.test.skip("ctypes backend: not supported: nested anonymous struct")
+
     def test_nested_anonymous_union(self):
         py.test.skip("ctypes backend: not supported: nested anonymous union")
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to