summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/libsample/overloadsort.h5
-rw-r--r--tests/samplebinding/overload_sorting_test.py4
-rw-r--r--tests/samplebinding/typesystem_sample.xml8
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/libsample/overloadsort.h b/tests/libsample/overloadsort.h
index c95c3572..b3a95bc0 100644
--- a/tests/libsample/overloadsort.h
+++ b/tests/libsample/overloadsort.h
@@ -71,6 +71,11 @@ public:
inline const char *overloadDeep(int x, ImplicitBase &y) {
return "ImplicitBase";
}
+
+
+ inline const char* pyObjOverload(int, int) { return "int,int"; }
+ inline const char* pyObjOverload(unsigned char*, int) { return "PyObject,int"; }
+
};
#endif // OVERLOADSORT_H
diff --git a/tests/samplebinding/overload_sorting_test.py b/tests/samplebinding/overload_sorting_test.py
index 9d4b1cbe..0cb86642 100644
--- a/tests/samplebinding/overload_sorting_test.py
+++ b/tests/samplebinding/overload_sorting_test.py
@@ -60,6 +60,10 @@ class SimpleOverloadSorting(unittest.TestCase):
'''Passing an implicit convertible object to an overload'''
self.assert_(self.obj.implicit_overload(ImplicitTarget()))
+ def testPyObjectSort(self):
+ self.assertEqual(self.obj.pyObjOverload(1, 2), "int,int")
+ self.assertEqual(self.obj.pyObjOverload(object(), 2), "PyObject,int")
+
class DeepOverloadSorting(unittest.TestCase):
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 2667c16d..63691605 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -992,6 +992,14 @@
return PyString_FromString("PyObject");
</inject-code>
</add-function>
+ <modify-function signature="pyObjOverload(unsigned char*, int)">
+ <modify-argument index="1">
+ <replace-type modified-type="PyObject" />
+ </modify-argument>
+ <inject-code>
+ unsigned char* %1 = 0;
+ </inject-code>
+ </modify-function>
</value-type>
<value-type name="ImplicitTarget"/>