aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-03-19 12:04:00 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-03-19 15:57:57 -0300
commitb8de1873b727e57ce627a3826e2fc7c3874a847d (patch)
treebb159f5596227df4fc546bcbafd25b4e3fefa85e /tests/samplebinding
parent0dad65f437926bb6520e022e533c08381056f890 (diff)
Adds a test for a method with modifications and custom conversion rules.
The test function does nothing in fact, it is there just to cause a situation that could cause a compilation problem if the generator is not working as it should. In other words if it compiles, then it is ok. :) The added method was a dummy clone of a similar QPixmap.loadFromData method signature that prevented QtGui from compiling properly. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Anderson Lizardo <anderson.lizardo@openbossa.org>
Diffstat (limited to 'tests/samplebinding')
-rw-r--r--tests/samplebinding/typesystem_sample.xml18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 05306f68c..eabc413f9 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -7,6 +7,7 @@
<primitive-type name="unsigned int" />
<primitive-type name="signed int" />
<primitive-type name="char"/>
+ <primitive-type name="unsigned char"/>
<primitive-type name="long"/>
<primitive-type name="unsigned long"/>
@@ -55,7 +56,22 @@
<enum-type name="Event::EventType"/>
<enum-type name="Abstract::Type"/>
- <namespace-type name="SampleNamespace"/>
+ <namespace-type name="SampleNamespace">
+ <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">
+ unsigned char* %out = reinterpret_cast&lt;unsigned char*>(PyString_AS_STRING(%PYARG_1));
+ </conversion-rule>
+ </modify-argument>
+ <modify-argument index="2">
+ <remove-argument/>
+ <conversion-rule class="native">
+ unsigned int %out = static_cast&lt;unsigned int>(PyString_GET_SIZE(%PYARG_1));
+ </conversion-rule>
+ </modify-argument>
+ </modify-function>
+ </namespace-type>
<object-type name="Abstract">
<modify-function signature="id()" rename="id_"/>