summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/typesystem_sample.xml
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-03-22 17:22:37 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-03-22 17:49:02 -0300
commitfc635bdc0a32888745d4428e6e033da7a9afbc7c (patch)
tree5ebabfa1c3bd0045337287db8a6b87aa7b48575a /tests/samplebinding/typesystem_sample.xml
parent60b44f86deb16f925dc5fac4602c638c47cbc614 (diff)
downloadshiboken-fc635bdc0a32888745d4428e6e033da7a9afbc7c.tar.gz
shiboken-fc635bdc0a32888745d4428e6e033da7a9afbc7c.tar.xz
shiboken-fc635bdc0a32888745d4428e6e033da7a9afbc7c.zip
Adds tests to type system modifications regarding reference to pointer type.
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'tests/samplebinding/typesystem_sample.xml')
-rw-r--r--tests/samplebinding/typesystem_sample.xml44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index eabc413f..14ce1e18 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -584,6 +584,50 @@
PyObject_Call(%PYTHON_METHOD_OVERRIDE, %PYTHON_ARGUMENTS, NULL);
</inject-code>
</modify-function>
+ <modify-function signature="createStr(const char*, Str*&amp;)">
+ <modify-argument index="2">
+ <remove-argument/>
+ </modify-argument>
+ <modify-argument index="return">
+ <replace-type modified-type="PySequence"/>
+ <conversion-rule class="native">
+ AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 0));
+ AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 1));
+ %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ok_);
+ %2 = %CONVERTTOCPP[Str*](_py_ret_);
+ </conversion-rule>
+ </modify-argument>
+ <inject-code class="target" position="beginning">
+ Str* _str_arg_ = 0;
+ %RETURN_TYPE %0 = %CPPSELF.%TYPE::%FUNCTION_NAME(%1, _str_arg_);
+ </inject-code>
+ <inject-code class="target" position="end">
+ %PYARG_0 = PyTuple_New(2);
+ PyObject* _item_ = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+ PyTuple_SET_ITEM(%PYARG_0, 0, _item_);
+ _item_ = %CONVERTTOPYTHON[Str*](_str_arg_);
+ PyTuple_SET_ITEM(%PYARG_0, 1, _item_);
+ </inject-code>
+ </modify-function>
+ <modify-function signature="callCreateStr(const char*, Str*&amp;)">
+ <modify-argument index="2">
+ <remove-argument/>
+ </modify-argument>
+ <modify-argument index="return">
+ <replace-type modified-type="PySequence"/>
+ </modify-argument>
+ <inject-code class="target" position="beginning">
+ Str* _str_arg_ = 0;
+ %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, _str_arg_);
+ </inject-code>
+ <inject-code class="target" position="end">
+ %PYARG_0 = PyTuple_New(2);
+ PyObject* _item_ = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
+ PyTuple_SET_ITEM(%PYARG_0, 0, _item_);
+ _item_ = %CONVERTTOPYTHON[Str*](_str_arg_);
+ PyTuple_SET_ITEM(%PYARG_0, 1, _item_);
+ </inject-code>
+ </modify-function>
</value-type>
<value-type name="VirtualDaughter" />