[pywin32-checkins] pywin32/win32/test test_win32event.py,1.1,1.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-10-02 01:31:40
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14129/test Modified Files: test_win32event.py Log Message: Fix for [ 2141368 ] win32event.MsgWaitForMultipleObjectsEx() segfaults from Ziga Seilnacht. Index: test_win32event.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32event.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_win32event.py 25 Jan 2005 07:53:35 -0000 1.1 --- test_win32event.py 2 Oct 2008 01:31:28 -0000 1.2 *************** *** 21,24 **** --- 21,47 ---- self.failUnlessEqual(rc, win32event.WAIT_TIMEOUT) + class TestWaitFunctions(unittest.TestCase): + def testMsgWaitForMultipleObjects(self): + # this function used to segfault when called with an empty list + res = win32event.MsgWaitForMultipleObjects([], 0, 0, 0) + self.assertEquals(res, win32event.WAIT_TIMEOUT) + + def testMsgWaitForMultipleObjects2(self): + # test with non-empty list + event = win32event.CreateEvent(None, 0, 0, None) + res = win32event.MsgWaitForMultipleObjects([event], 0, 0, 0) + self.assertEquals(res, win32event.WAIT_TIMEOUT) + + def testMsgWaitForMultipleObjectsEx(self): + # this function used to segfault when called with an empty list + res = win32event.MsgWaitForMultipleObjectsEx([], 0, 0, 0) + self.assertEquals(res, win32event.WAIT_TIMEOUT) + + def testMsgWaitForMultipleObjectsEx2(self): + # test with non-empty list + event = win32event.CreateEvent(None, 0, 0, None) + res = win32event.MsgWaitForMultipleObjectsEx([event], 0, 0, 0) + self.assertEquals(res, win32event.WAIT_TIMEOUT) + if __name__=='__main__': unittest.main() |