aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-23 13:36:05 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-24 13:18:19 +0100
commitdf72cfdfffc00c74f542f27475d651f7c6d088fa (patch)
tree1e84bcb4004ea49cc243b838f3e94f08f215862e
parentf680ebe731c447010f91393f1d35719e1596b48b (diff)
shiboken6: Add a test for operator nb_bool of smart pointers
Task-number: PYSIDE-454 Pick-to: 6.2 Change-Id: I849d0a855395846f7cbe9cd97685457627dfd1a2 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken6/tests/smartbinding/smart_pointer_test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/smartbinding/smart_pointer_test.py b/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
index ce976e1ca..3cafb74b9 100644
--- a/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
+++ b/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
@@ -272,6 +272,12 @@ class SmartPointerTests(unittest.TestCase):
self.assertFalse(o1 == o2)
self.assertTrue(o1 != o2)
+ def testOperatorNbBool(self):
+ null_ptr = Obj.createNullSharedPtrToInteger()
+ self.assertFalse(null_ptr)
+ zero = Obj.createSharedPtrToInteger(0)
+ self.assertTrue(zero)
+
if __name__ == '__main__':
unittest.main()