r58729 - python/branches/ctypes-branch/Lib/ctypes/test/test_cfuncs.py python/branches/ctypes-branch/Lib/ctypes/test/test_functions.py
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
Author: thomas.heller Date: Wed Oct 31 08:56:42 2007 New Revision: 58729 Modified: python/branches/ctypes-branch/Lib/ctypes/test/test_cfuncs.py python/branches/ctypes-branch/Lib/ctypes/test/test_functions.py Log: Enable all the c_longdouble tests again. Modified: python/branches/ctypes-branch/Lib/ctypes/test/test_cfuncs.py ============================================================================== --- python/branches/ctypes-branch/Lib/ctypes/test/test_cfuncs.py (original) +++ python/branches/ctypes-branch/Lib/ctypes/test/test_cfuncs.py Wed Oct 31 08:56:42 2007 @@ -158,17 +158,17 @@ self.failUnlessEqual(self._dll.tf_bd(0, 42.), 14.) self.failUnlessEqual(self.S(), 42) -## def test_longdouble(self): -## self._dll.tf_D.restype = c_longdouble -## self._dll.tf_D.argtypes = (c_longdouble,) -## self.failUnlessEqual(self._dll.tf_D(42.), 14.) -## self.failUnlessEqual(self.S(), 42) - -## def test_longdouble_plus(self): -## self._dll.tf_bD.restype = c_longdouble -## self._dll.tf_bD.argtypes = (c_byte, c_longdouble) -## self.failUnlessEqual(self._dll.tf_bD(0, 42.), 14.) -## self.failUnlessEqual(self.S(), 42) + def test_longdouble(self): + self._dll.tf_D.restype = c_longdouble + self._dll.tf_D.argtypes = (c_longdouble,) + self.failUnlessEqual(self._dll.tf_D(42.), 14.) + self.failUnlessEqual(self.S(), 42) + + def test_longdouble_plus(self): + self._dll.tf_bD.restype = c_longdouble + self._dll.tf_bD.argtypes = (c_byte, c_longdouble) + self.failUnlessEqual(self._dll.tf_bD(0, 42.), 14.) + self.failUnlessEqual(self.S(), 42) def test_callwithresult(self): def process_result(result): Modified: python/branches/ctypes-branch/Lib/ctypes/test/test_functions.py ============================================================================== --- python/branches/ctypes-branch/Lib/ctypes/test/test_functions.py (original) +++ python/branches/ctypes-branch/Lib/ctypes/test/test_functions.py Wed Oct 31 08:56:42 2007 @@ -143,17 +143,17 @@ self.failUnlessEqual(result, -21) self.failUnlessEqual(type(result), float) -## def test_longdoubleresult(self): -## f = dll._testfunc_D_bhilfD -## f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_longdouble] -## f.restype = c_longdouble -## result = f(1, 2, 3, 4, 5.0, 6.0) -## self.failUnlessEqual(result, 21) -## self.failUnlessEqual(type(result), float) - -## result = f(-1, -2, -3, -4, -5.0, -6.0) -## self.failUnlessEqual(result, -21) -## self.failUnlessEqual(type(result), float) + def test_longdoubleresult(self): + f = dll._testfunc_D_bhilfD + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_longdouble] + f.restype = c_longdouble + result = f(1, 2, 3, 4, 5.0, 6.0) + self.failUnlessEqual(result, 21) + self.failUnlessEqual(type(result), float) + + result = f(-1, -2, -3, -4, -5.0, -6.0) + self.failUnlessEqual(result, -21) + self.failUnlessEqual(type(result), float) def test_longlongresult(self): try:
participants (1)
-
thomas.heller