diff --git a/tests/foo.h b/tests/foo.h index d48fff6..93f43a0 100644 --- a/tests/foo.h +++ b/tests/foo.h @@ -512,6 +512,15 @@ namespace xpto typedef Foo FooXpto; std::string get_foo_datum(FooXpto const &foo); + + struct XptoClass + { + SomeClass* GetSomeClass() + // -#- @return(caller_owns_return=true) -#- + { + return NULL; + } + }; } // -#- @return(custodian=1, reference_existing_object=true); @other(transfer_ownership=false) -#- diff --git a/tests/foomodulegen.py b/tests/foomodulegen.py index a4927cd..ea301c0 100755 --- a/tests/foomodulegen.py +++ b/tests/foomodulegen.py @@ -12,7 +12,7 @@ from pybindgen.function import CustomFunctionWrapper from pybindgen.cppmethod import CustomCppMethodWrapper from pybindgen import cppclass -from pybindgen import param +from pybindgen import param, retval import foomodulegen_common @@ -298,6 +298,10 @@ int %s::custom_method_added_by_a_hook(int x) typehandlers.add_type_alias('uint32_t', 'xpto::FlowId') xpto.add_function('get_flow_id', 'xpto::FlowId', [Parameter.new('xpto::FlowId', 'flowId')]) + + # bug #798383 + XptoClass = xpto.add_struct('XptoClass') + XptoClass.add_method("GetSomeClass", retval("xpto::SomeClass*", caller_owns_return=True), []) ## ---- some implicity conversion APIs