summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 16:55:05 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 18:39:53 -0300
commitbc4b77ef8cc4f17973d416c44521c65b66bc2bc7 (patch)
tree36fbfbf3062124e167d302b958bc30d92eec7f69
parent72af00dc0491b5c2f14bf0fd3c4d2c5e3fdf4c71 (diff)
downloadshiboken-bc4b77ef8cc4f17973d416c44521c65b66bc2bc7.tar.gz
shiboken-bc4b77ef8cc4f17973d416c44521c65b66bc2bc7.tar.xz
shiboken-bc4b77ef8cc4f17973d416c44521c65b66bc2bc7.zip
Added unit test for crash with references, None types and comparison functions.
-rwxr-xr-xtests/samplebinding/reference_test.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/samplebinding/reference_test.py b/tests/samplebinding/reference_test.py
index 4157b342..f00e036e 100755
--- a/tests/samplebinding/reference_test.py
+++ b/tests/samplebinding/reference_test.py
@@ -29,7 +29,7 @@
import sys
import unittest
-from sample import Reference
+from sample import *
class ExtendedReference(Reference):
def __init__(self):
@@ -61,6 +61,11 @@ class ReferenceTest(unittest.TestCase):
r = Reference(objId)
self.assertEqual(Reference.usesReference(r), objId)
+ def testCantSegFaultWhenReceiveNone(self):
+ '''do not segfault when receiving None as argument.'''
+ s = Str()
+ self.assertEqual(None, s)
+
def testMethodThatReceivesConstReference(self):
'''Test a method that receives a const reference to an object as argument.'''
objId = 123