diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/samplebinding/objecttypeoperators_test.py | 3 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/samplebinding/objecttypeoperators_test.py b/tests/samplebinding/objecttypeoperators_test.py index 148bc3591..71e5a5d40 100644 --- a/tests/samplebinding/objecttypeoperators_test.py +++ b/tests/samplebinding/objecttypeoperators_test.py @@ -47,6 +47,9 @@ class ObjectTypeOperatorsTest(unittest.TestCase): self.assertEqual("a", a) self.assertEqual(a, "a") + def testOperatorInjection(self): + a = ObjectTypeOperators("a") + self.assertNotEqual(a, "b") if __name__ == '__main__': unittest.main() diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 576c54656..5a518c34a 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -1274,7 +1274,13 @@ <object-type name="HandleHolder" /> - <object-type name="ObjectTypeOperators" /> + <object-type name="ObjectTypeOperators"> + <add-function signature="operator!=(std::string)" return-type="bool"> + <inject-code class="target"> + %PYARG_0 = %CONVERTTOPYTHON[bool](%CPPSELF.key() != %1); + </inject-code> + </add-function> + </object-type> <!-- type used in abstract method --> <object-type name="HideType" generate="no" /> |