summaryrefslogtreecommitdiff
path: root/testing/cffi1/test_re_python.py
diff options
context:
space:
mode:
authorSergey Vorfolomeev <sergey.vorfolomeev@vmssoftware.com>2021-04-09 08:29:05 +0500
committerSergey Vorfolomeev <sergey.vorfolomeev@vmssoftware.com>2021-04-09 08:29:05 +0500
commitc48fc339035511967023aa9783ce8afc1c00a492 (patch)
treea59352e46c3497219973c15158cd1231876099a9 /testing/cffi1/test_re_python.py
parent836a60368633def79b7fe439be845f5272f4bc9e (diff)
parentf17762f93b1f882554b6fe12c8271f907aebf6ad (diff)
downloadcffi-openvms.tar.gz
merge default to 'openvms'openvms
changed: .hgtags c/_cffi_backend.c c/ffi_obj.c c/test_c.py cffi/__init__.py cffi/_embedding.h cffi/recompiler.py cffi/verifier.py doc/source/conf.py doc/source/installation.rst doc/source/whatsnew.rst setup.py setup_base.py testing/cffi0/test_ffi_backend.py testing/cffi0/test_version.py testing/cffi1/test_re_python.py
Diffstat (limited to 'testing/cffi1/test_re_python.py')
-rw-r--r--testing/cffi1/test_re_python.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py
index dce4f40..2ae0dd1 100644
--- a/testing/cffi1/test_re_python.py
+++ b/testing/cffi1/test_re_python.py
@@ -74,6 +74,7 @@ def setup_module(mod):
int strlen(const char *);
struct with_union { union { int a; char b; }; };
union with_struct { struct { int a; char b; }; };
+ struct with_struct_with_union { struct { union { int x; }; } cp; };
struct NVGcolor { union { float rgba[4]; struct { float r,g,b,a; }; }; };
typedef struct selfref { struct selfref *next; } *selfref_ptr_t;
""")
@@ -248,6 +249,10 @@ def test_anonymous_union_inside_struct():
assert ffi.offsetof("union with_struct", "b") == INT
assert ffi.sizeof("union with_struct") >= INT + 1
#
+ assert ffi.sizeof("struct with_struct_with_union") == INT
+ p = ffi.new("struct with_struct_with_union *")
+ assert p.cp.x == 0
+ #
FLOAT = ffi.sizeof("float")
assert ffi.sizeof("struct NVGcolor") == FLOAT * 4
assert ffi.offsetof("struct NVGcolor", "rgba") == 0