aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests/samplebinding/oddbool_test.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-22 14:42:50 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-22 15:49:00 +0200
commitc58c3e5a99a4dee992fd4c7898185181ecc84ae7 (patch)
tree89fcc73e03658ade4c0e8155e8aceccaf263b00e /sources/shiboken2/tests/samplebinding/oddbool_test.py
parent2dc1b659921d72aeac1c12d8c903de9704e6419f (diff)
Enable adding operators ==, != as functions without code injection
As of Qt 6, there is a trend of hiding bool returns of comparison operators of container classes behind some template expression which the clang parser cannot identify. To work arouind such cases, make it possible to add them as functions without code injection which will generate the default code. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia7bf5d583e0f80505fe1b759347955fec5dca600 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/tests/samplebinding/oddbool_test.py')
-rw-r--r--sources/shiboken2/tests/samplebinding/oddbool_test.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/shiboken2/tests/samplebinding/oddbool_test.py b/sources/shiboken2/tests/samplebinding/oddbool_test.py
index de1429604..5334e970c 100644
--- a/sources/shiboken2/tests/samplebinding/oddbool_test.py
+++ b/sources/shiboken2/tests/samplebinding/oddbool_test.py
@@ -39,7 +39,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from shiboken_paths import init_paths
init_paths()
-from sample import OddBoolUser
+from sample import OddBoolUser, ComparisonTester
class DerivedOddBoolUser (OddBoolUser):
def returnMyselfVirtual(self):
@@ -80,5 +80,11 @@ class OddBoolTest(unittest.TestCase):
obu = OddBoolUser(cpx)
self.assertFalse(obu.oddBool())
+ def testOddOperators(self):
+ t1 = ComparisonTester(42)
+ t2 = ComparisonTester(42)
+ self.assertEqual(t1, t2)
+
+
if __name__ == '__main__':
unittest.main()