[pywin32-checkins] pywin32/win32/test handles.py, 1.5, 1.6 test_win32event.py, 1.2, 1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-25 03:20:48
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31852/win32/test Modified Files: handles.py test_win32event.py Log Message: Use int2long to make tests py3k-friendly Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** handles.py 11 Dec 2008 07:00:12 -0000 1.5 --- handles.py 25 Jan 2009 03:20:43 -0000 1.6 *************** *** 3,6 **** --- 3,7 ---- import pywintypes import win32api + from pywin32_testutil import int2long # A class that will never die vie refcounting, but will die via GC. *************** *** 108,112 **** self.assertRaises(TypeError, pywintypes.HANDLE, ()) # should be able to get a long! ! pywintypes.HANDLE(0L) if __name__ == '__main__': --- 109,113 ---- self.assertRaises(TypeError, pywintypes.HANDLE, ()) # should be able to get a long! ! pywintypes.HANDLE(int2long(0)) if __name__ == '__main__': Index: test_win32event.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32event.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_win32event.py 2 Oct 2008 01:31:28 -0000 1.2 --- test_win32event.py 25 Jan 2009 03:20:43 -0000 1.3 *************** *** 4,12 **** import os import sys class TestWaitableTimer(unittest.TestCase): def testWaitableFire(self): h = win32event.CreateWaitableTimer(None, 0, None) ! dt = -160L # 160 ns. win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 1000) --- 4,20 ---- import os import sys + from pywin32_testutil import int2long class TestWaitableTimer(unittest.TestCase): + def testWaitableFireLong(self): + h = win32event.CreateWaitableTimer(None, 0, None) + dt = int2long(-160) # 160 ns. + win32event.SetWaitableTimer(h, dt, 0, None, None, 0) + rc = win32event.WaitForSingleObject(h, 1000) + self.failUnlessEqual(rc, win32event.WAIT_OBJECT_0) + def testWaitableFire(self): h = win32event.CreateWaitableTimer(None, 0, None) ! dt = -160 # 160 ns. win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 1000) *************** *** 16,20 **** h = win32event.CreateWaitableTimer(None, 0, None) # for the sake of this, pass a long that doesn't fit in an int. ! dt = -2000000000L win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 10) # 10 ms. --- 24,28 ---- h = win32event.CreateWaitableTimer(None, 0, None) # for the sake of this, pass a long that doesn't fit in an int. ! dt = -2000000000 win32event.SetWaitableTimer(h, dt, 0, None, None, 0) rc = win32event.WaitForSingleObject(h, 10) # 10 ms. |