aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-09-13 16:32:47 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:27 -0300
commitff0b861b59b41387e771d9cd565e13de8b2750d1 (patch)
treefccaea50e4150a8345494833f97aaf0d147f7177 /tests/samplebinding
parent0adc55471d864d307034dd995d6c70c18952b279 (diff)
Shiboken exits with error for not handled pointers to primitive types.
Diffstat (limited to 'tests/samplebinding')
-rw-r--r--tests/samplebinding/typesystem_sample.xml38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index ac865df69..ae24245fc 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -118,6 +118,44 @@
</conversion-rule>
</primitive-type>
+ <function signature="changePStr(PStr*, const char*)">
+ <!--
+ Comment out these modifications and the Shiboken generator
+ will issue a fatal error, because it can't handle a pointer
+ to a primitive type (PStr*) without help from the binding
+ developer.
+ -->
+ <modify-function signature="changePStr(PStr*, const char*)">
+ <modify-argument index="1">
+ <replace-type modified-type="PStr"/>
+ </modify-argument>
+ <modify-argument index="return">
+ <replace-type modified-type="PyObject"/>
+ </modify-argument>
+ <inject-code class="target" position="beginning">
+ %FUNCTION_NAME(&amp;%1, %2);
+ %PYARG_0 = %CONVERTTOPYTHON[PStr](%1);
+ </inject-code>
+ </modify-function>
+ </function>
+
+ <function signature="duplicatePStr(PStr*)">
+ <modify-function signature="duplicatePStr(PStr*)">
+ <modify-argument index="return">
+ <replace-type modified-type="PyObject"/>
+ </modify-argument>
+ <modify-argument index="1">
+ <replace-type modified-type="PStr"/>
+ <remove-default-expression/>
+ <replace-default-expression with="PStr()"/>
+ </modify-argument>
+ <inject-code class="target" position="end">
+ %FUNCTION_NAME(&amp;%1);
+ %PYARG_0 = %CONVERTTOPYTHON[PStr](%1);
+ </inject-code>
+ </modify-function>
+ </function>
+
<primitive-type name="PStrList">
<include file-name="strlist.h" location="global"/>
<conversion-rule>