diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libsample/reference.h | 3 | ||||
-rw-r--r-- | tests/samplebinding/ignorederefop_test.py | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/libsample/reference.h b/tests/libsample/reference.h index 54360d880..588644a2a 100644 --- a/tests/libsample/reference.h +++ b/tests/libsample/reference.h @@ -53,6 +53,9 @@ public: virtual Reference& returnMyFirstArg(Reference& ref) { return ref; } virtual Reference& returnMySecondArg(int a, Reference& ref) { return ref; } + + // nonsense operator to test if Shiboken is ignoring dereference operators. + int operator*() { return m_objId; } private: int m_objId; }; diff --git a/tests/samplebinding/ignorederefop_test.py b/tests/samplebinding/ignorederefop_test.py new file mode 100644 index 000000000..94e726468 --- /dev/null +++ b/tests/samplebinding/ignorederefop_test.py @@ -0,0 +1,10 @@ +import unittest +from sample import * + +class TestLackOfDereferenceOperators (unittest.TestCase): + def testIf(self): + r = Reference() + self.assertFalse(hasattr(r, "__mul__")) + +if __name__ == '__main__': + unittest.main() |