aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/samplebinding
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-01-11 17:50:36 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-01-18 16:33:25 +0100
commitc1e64f5e5583ba6e9e36bf54327747018a2541bc (patch)
treeffa8b7cd64b671cdcc2432fab6ed2bc9fc7cf493 /sources/shiboken6/tests/samplebinding
parent26a1b40e4fa878a11995528dcf04158b44477477 (diff)
shiboken6/Type system parser: Handle native-to-target and vv in argument conversion rules
Introduce new parser states and handle it accordingly in </native-to-target> and </target-to-native>. Use it in the sample tests. Pick-to: 6.2 Fixes: PYSIDE-1766 Change-Id: Id00dd3ad65799c497b008499c02fbf7ee2e5f856 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/tests/samplebinding')
-rw-r--r--sources/shiboken6/tests/samplebinding/typesystem_sample.xml28
1 files changed, 18 insertions, 10 deletions
diff --git a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml
index 5ec2c6302..7d463b3a5 100644
--- a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml
+++ b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml
@@ -486,8 +486,12 @@
<modify-function signature="doSomethingWithArray(const unsigned char*, unsigned int, const char*)">
<modify-argument index="1">
<replace-type modified-type="const char*"/>
- <conversion-rule class="native">
- const unsigned char* %out = reinterpret_cast&lt;const unsigned char*>(Shiboken::String::toCString(%PYARG_1));
+ <conversion-rule>
+ <target-to-native>
+ <add-conversion>
+ const unsigned char* %out = reinterpret_cast&lt;const unsigned char*>(Shiboken::String::toCString(%PYARG_1));
+ </add-conversion>
+ </target-to-native>
</conversion-rule>
</modify-argument>
<modify-argument index="2">
@@ -1161,14 +1165,18 @@
</modify-argument>
<modify-argument index="return">
<replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- Shiboken::AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 0));
- Shiboken::AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 1));
- *%2 = %CONVERTTOCPP[bool](_py_ok_);
- %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ret_);
- </conversion-rule>
- <conversion-rule class="target">
- <insert-template name="differenceOfPointCoordinates_returnTarget"/>
+ <conversion-rule>
+ <target-to-native>
+ <add-conversion>
+ Shiboken::AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 0));
+ Shiboken::AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 1));
+ *%2 = %CONVERTTOCPP[bool](_py_ok_);
+ %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ret_);
+ </add-conversion>
+ </target-to-native>
+ <native-to-target>
+ <insert-template name="differenceOfPointCoordinates_returnTarget"/>
+ </native-to-target>
</conversion-rule>
</modify-argument>
</modify-function>