[ctypes-commit] ctypes/unittests test_parameters.py,1.21,1.22
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-04-30 14:49:56
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28287 Modified Files: test_parameters.py Log Message: Use failUnlessEqual because of the better error message, whereever possible. Index: test_parameters.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_parameters.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_parameters.py 20 Apr 2004 20:16:28 -0000 1.21 --- test_parameters.py 30 Apr 2004 14:49:38 -0000 1.22 *************** *** 34,38 **** pa = c_wchar_p.from_param(c_wchar_p(u"123")) ! self.failUnless(type(pa) == c_wchar_p) def test_int_pointers(self): --- 34,38 ---- pa = c_wchar_p.from_param(c_wchar_p(u"123")) ! self.failUnlessEqual(type(pa), c_wchar_p) def test_int_pointers(self): *************** *** 43,50 **** ## x = LPINT.from_param(p) x = LPINT.from_param(pointer(c_int(42))) ! self.failUnless(x.contents.value == 42) ! self.failUnless(LPINT(c_int(42)).contents.value == 42) ! self.failUnless(LPINT.from_param(None) == 0) self.assertRaises(TypeError, LPINT.from_param, pointer(c_long(42))) --- 43,50 ---- ## x = LPINT.from_param(p) x = LPINT.from_param(pointer(c_int(42))) ! self.failUnlessEqual(x.contents.value, 42) ! self.failUnlessEqual(LPINT(c_int(42)).contents.value, 42) ! self.failUnlessEqual(LPINT.from_param(None), 0) self.assertRaises(TypeError, LPINT.from_param, pointer(c_long(42))) *************** *** 79,84 **** INTARRAY = c_int * 3 ia = INTARRAY() ! self.failUnless(len(ia) == 3) ! self.failUnless([ia[i] for i in range(3)] == [0, 0, 0]) # Pointers are only compatible with arrays containing items of --- 79,84 ---- INTARRAY = c_int * 3 ia = INTARRAY() ! self.failUnlessEqual(len(ia), 3) ! self.failUnlessEqual([ia[i] for i in range(3)], [0, 0, 0]) # Pointers are only compatible with arrays containing items of |