aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/smartbinding/smart_pointer_test.py')
-rw-r--r--sources/shiboken6/tests/smartbinding/smart_pointer_test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/smartbinding/smart_pointer_test.py b/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
index 64267fba7..761478df0 100644
--- a/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
+++ b/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
@@ -288,6 +288,14 @@ class SmartPointerTests(unittest.TestCase):
o.takeSharedPtrToInteger(None)
o.takeSharedPtrToIntegerByConstRef(None)
+ def testNoneConversion(self):
+ """PYSIDE-3253: SharedPtr2 is configured to convert to None."""
+ valid_ptr = Obj.createSharedPtr2Integer(42)
+ null_ptr = Obj.createNullSharedPtr2Integer()
+ self.assertEqual(valid_ptr.value(), 42)
+ self.assertFalse(valid_ptr is None)
+ self.assertTrue(null_ptr is None)
+
def testConstruction(self):
p1 = SharedPtr_Integer(integerFromValue(42))
self.assertEqual(p1.value(), 42)