summaryrefslogtreecommitdiff
path: root/testing/cffi0/test_verify.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/cffi0/test_verify.py')
-rw-r--r--testing/cffi0/test_verify.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/testing/cffi0/test_verify.py b/testing/cffi0/test_verify.py
index 5308e1d..e600908 100644
--- a/testing/cffi0/test_verify.py
+++ b/testing/cffi0/test_verify.py
@@ -1075,9 +1075,13 @@ def test_autofilled_struct_as_argument_dynamic():
int (*foo)(struct foo_s s) = &foo1;
""")
e = py.test.raises(NotImplementedError, lib.foo, "?")
- msg = ("ctype 'struct foo_s' not supported as argument (it is a struct "
- 'declared with "...;", but the C calling convention may depend '
- 'on the missing fields)')
+ msg = ("ctype 'struct foo_s' not supported as argument. It is a struct "
+ 'declared with "...;", but the C calling convention may depend on '
+ "the missing fields; or, it contains anonymous struct/unions. "
+ "Such structs are only supported as argument "
+ "if the function is 'API mode' and non-variadic (i.e. declared "
+ "inside ffibuilder.cdef()+ffibuilder.set_source() and not taking "
+ "a final '...' argument)")
assert str(e.value) == msg
def test_func_returns_struct():
@@ -2146,14 +2150,23 @@ def test_consider_not_implemented_function_type():
# assert did not crash so far
e = py.test.raises(NotImplementedError, fooptr, ffi.new("Data *"))
assert str(e.value) == (
- "ctype 'Data' (size 4) not supported as argument")
+ "ctype 'Data' not supported as argument by libffi. Unions are only "
+ "supported as argument if the function is 'API mode' and "
+ "non-variadic (i.e. declared inside ffibuilder.cdef()+"
+ "ffibuilder.set_source() and not taking a final '...' argument)")
e = py.test.raises(NotImplementedError, bazptr)
assert str(e.value) == (
- "ctype 'Data' (size 4) not supported as return value")
+ "ctype 'Data' not supported as return value by libffi. Unions are "
+ "only supported as return value if the function is 'API mode' and "
+ "non-variadic (i.e. declared inside ffibuilder.cdef()+"
+ "ffibuilder.set_source() and not taking a final '...' argument)")
e = py.test.raises(NotImplementedError, barptr)
assert str(e.value) == (
- "ctype 'MyStr' not supported as return value "
- "(it is a struct with bit fields)")
+ "ctype 'MyStr' not supported as return value. It is a struct with "
+ "bit fields, which libffi does not support. Such structs are only "
+ "supported as return value if the function is 'API mode' and non-"
+ "variadic (i.e. declared inside ffibuilder.cdef()+ffibuilder."
+ "set_source() and not taking a final '...' argument)")
def test_verify_extra_arguments():
ffi = FFI()