aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-08-21 08:18:20 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-08-22 07:38:29 +0200
commit6eb583d77019ad03112c188b20063e2199486235 (patch)
treedd60ba6b8ac7397b347aebc4e801d37c9028e4df /sources/shiboken2/tests/smartbinding/smart_pointer_test.py
parentb33f0c3708c16821a846013d28ca600863003b3e (diff)
parentd9225ff6dd397af9558a882de2a33a981e994a53 (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into dev"
Diffstat (limited to 'sources/shiboken2/tests/smartbinding/smart_pointer_test.py')
-rw-r--r--sources/shiboken2/tests/smartbinding/smart_pointer_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/shiboken2/tests/smartbinding/smart_pointer_test.py b/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
index e07856e61..e1883c7cc 100644
--- a/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
+++ b/sources/shiboken2/tests/smartbinding/smart_pointer_test.py
@@ -175,5 +175,17 @@ class SmartPointerTests(unittest.TestCase):
self.assertEqual(len(ptrToObjList), 0)
self.assertEqual(objCount(), 1)
+ def testInvalidParameter(self):
+ # Create Obj.
+ o = Obj()
+ # Create a shared pointer to an Obj together with an Obj.
+ ptrToObj = o.giveSharedPtrToObj()
+ try:
+ ptrToObj.typo
+ self.assertFail()
+ except AttributeError as error:
+ self.assertEqual(error.args[0], "'smart.SharedPtr_Obj' object has no attribute 'typo'")
+
+
if __name__ == '__main__':
unittest.main()