Fix handling of NULL default argument values for pointer types.

Accept not only manifest pointer types (such as e.g. "void *") but also types
that are typedefs for pointer types when checking whether C++ value of 0 must
be represented as 0 or None in Python.

Closes #365, #376.
This commit is contained in:
Vadim Zeitlin 2015-04-22 19:30:55 +02:00
commit 0eae8a8efa
4 changed files with 35 additions and 2 deletions

View file

@ -31,6 +31,17 @@ def run(module_name):
f.newname()
f.newname(1)
if f.double_if_void_ptr_is_null(2, None) != 4:
raise RuntimeError
if f.double_if_void_ptr_is_null(3) != 6:
raise RuntimeError
if f.double_if_handle_is_null(4, None) != 8:
raise RuntimeError
if f.double_if_handle_is_null(5) != 10:
raise RuntimeError
try:
f = default_args.Foo(1)