aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
Diffstat (limited to 'tests/samplebinding')
-rw-r--r--tests/samplebinding/modifications_test.py6
-rw-r--r--tests/samplebinding/typesystem_sample.xml15
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/samplebinding/modifications_test.py b/tests/samplebinding/modifications_test.py
index 344801015..3cb502ce6 100644
--- a/tests/samplebinding/modifications_test.py
+++ b/tests/samplebinding/modifications_test.py
@@ -148,5 +148,11 @@ class ModificationsTest(unittest.TestCase):
self.assertEqual(self.mods.sumPointCoordinates(point), 12 + 34)
self.assertRaises(TypeError, self.mods.sumPointCoordinates, None)
+ def testNonConversionRuleForArgumentWithDefaultValue(self):
+ status, obj = self.mods.nonConversionRuleForArgumentWithDefaultValue()
+ self.assert_(status)
+ self.assertEqual(obj, self.mods.getObject())
+ self.assertEqual(obj.objectName(), 'MyObject')
+
if __name__ == '__main__':
unittest.main()
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index dc4faf352..4f1d5481b 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -728,6 +728,19 @@
<no-null-pointer/>
</modify-argument>
</modify-function>
+ <modify-function signature="nonConversionRuleForArgumentWithDefaultValue(ObjectType**)">
+ <modify-argument index="1">
+ <remove-argument/>
+ </modify-argument>
+ <modify-argument index="return">
+ <replace-type modified-type="(status, object)"/>
+ </modify-argument>
+ <inject-code class="target" position="beginning">
+ ObjectType* tmpObject = 0;
+ %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(&amp;tmpObject);
+ %PYARG_0 = Shiboken::makeTuple(%0, tmpObject);
+ </inject-code>
+ </modify-function>
</object-type>
<object-type name="AbstractModifications">
@@ -1761,4 +1774,4 @@
<!-- Do not fix this warning, the generator should be able to handle this situation for Object Types. -->
<suppress-warning text="Argument in position 1 of added function 'SampleNamespace::passReferenceToObjectType(ObjectType * arg__1)', has a type that is not a reference, while the argument in the corresponding position in C++ function 'SampleNamespace::passReferenceToObjectType(const ObjectType &amp; obj, int multiplier)' is a reference." />
-</typesystem> \ No newline at end of file
+</typesystem>