diff options
author | Armin Rigo <arigo@tunes.org> | 2012-08-05 09:23:10 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2012-08-05 09:23:10 +0200 |
commit | 99df488b7d502288ddc2561ede1c034129a57961 (patch) | |
tree | 7abcdb495386c52a7ad1ef5b1df57ef835b03fa2 | |
parent | d46f23fec77b7e41da1509a87d702431c740e863 (diff) | |
download | cffi-99df488b7d502288ddc2561ede1c034129a57961.tar.gz |
Add a skipped test
-rw-r--r-- | testing/backend_tests.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/backend_tests.py b/testing/backend_tests.py index 99888aa..597de52 100644 --- a/testing/backend_tests.py +++ b/testing/backend_tests.py @@ -1229,3 +1229,26 @@ class BackendTests: ffi.cdef("enum e { AA=0, BB=0, CC=0, DD=0 };") e = ffi.cast("enum e", 'CC') assert ffi.string(e) == "AA" # pick the first one arbitrarily + + def test_nested_anonymous_struct(self): + py.test.skip("later") + ffi = FFI(backend=self.Backend()) + ffi.cdef(""" + struct foo_s { + struct { int a, b; }; + union { int c, d; }; + }; + """) + assert ffi.sizeof("struct foo_s") == 3 * SIZE_OF_INT + p = ffi.new("struct foo_s *", [[1], [3]]) + assert p.a == 1 + assert p.b == 0 + assert p.c == 3 + assert p.d == 3 + p.d = 17 + assert p.c == 17 + p.b = 19 + assert p.a == 1 + assert p.b == 19 + assert p.c == 17 + assert p.d == 17 |