diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-28 16:23:55 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-28 19:31:55 -0200 |
commit | 4835555d4874527ddaf4b0c3bb4c017da96fa9c0 (patch) | |
tree | e6264425ca9e71c84c3774f31a10c583a46a144b /tests | |
parent | 420098145e4e6e2311e987f45c440ed01902a9cb (diff) | |
download | shiboken-4835555d4874527ddaf4b0c3bb4c017da96fa9c0.tar.gz shiboken-4835555d4874527ddaf4b0c3bb4c017da96fa9c0.tar.xz shiboken-4835555d4874527ddaf4b0c3bb4c017da96fa9c0.zip |
Fix regression that caused overload sorting to not respect argument type renames.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libsample/overloadsort.h | 5 | ||||
-rw-r--r-- | tests/samplebinding/overload_sorting_test.py | 4 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 8 |
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"/> |