diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-17 21:23:33 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-18 08:47:47 -0300 |
commit | da6117eb38e4e9a505a2b5c445551bf7ea4b89e1 (patch) | |
tree | a4452cc3b3b6deb41984a9f3da302945d1a64921 /tests/samplebinding/return_null_test.py | |
parent | d2b4c0304ef15deca43c4802c1255ece46f5af53 (diff) |
Fixed C string toPython converter to return Py_None when a NULL pointer
is received.
Fixed and improved the test for functions returning NULL pointer values.
Diffstat (limited to 'tests/samplebinding/return_null_test.py')
-rwxr-xr-x | tests/samplebinding/return_null_test.py | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/samplebinding/return_null_test.py b/tests/samplebinding/return_null_test.py index 907dd8a57..46c13e89d 100755 --- a/tests/samplebinding/return_null_test.py +++ b/tests/samplebinding/return_null_test.py @@ -24,18 +24,31 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA -'''Test cases for Abstract class''' +'''Test case for functions that could return a NULL pointer.''' import sys import unittest -from sample import returnNull +from sample import returnNullPrimitivePointer, returnNullValueTypePointer, returnNullObjectTypePointer -class RetrunTest(unittest.TestCase): - '''Test case for functions with null return''' +class ReturnNullTest(unittest.TestCase): + '''Test case for functions that could return a NULL pointer.''' - def testNull(self): - o = returnNull() - self.assert_(o == None) + def testReturnNull(self): + '''Function returns a NULL pointer to a primitive type.''' + o = returnNullPrimitivePointer() + self.assertEqual(o, None) + def testReturnNullObjectType(self): + '''Function returns a NULL pointer to an object-type.''' + o = returnNullObjectTypePointer() + self.assertEqual(o, None) + + def testReturnNullValueType(self): + '''Function returns a NULL pointer to a value-type.''' + o = returnNullValueTypePointer() + self.assertEqual(o, None) + +if __name__ == '__main__': + unittest.main() |