From 9c6b541ceef3039e9e19a1d9a12223851a849cf6 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Wed, 10 Aug 2011 00:59:19 -0300 Subject: Improved the generation of argument conversion in modified functions. Added the SBK_UNUSED macro to libshiboken to prevent compilation warnings. An unit test was added. Reviewed by Hugo Parente Reviewed by Luciano Wolf --- tests/samplebinding/modifications_test.py | 6 ++++++ tests/samplebinding/typesystem_sample.xml | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'tests/samplebinding') 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 @@ + + + + + + + + + ObjectType* tmpObject = 0; + %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(&tmpObject); + %PYARG_0 = Shiboken::makeTuple(%0, tmpObject); + + @@ -1761,4 +1774,4 @@ - \ No newline at end of file + -- cgit v1.2.3