#11973: add test for previously fixed kevent signed/unsigned bug.

Patch by David Naylor.
This commit is contained in:
R David Murray 2014-10-12 12:39:46 -04:00
parent 62b08136d7
commit 90f7afda61
1 changed files with 25 additions and 0 deletions

View File

@ -86,6 +86,31 @@ class TestKQueue(unittest.TestCase):
self.assertEqual(ev, ev) self.assertEqual(ev, ev)
self.assertNotEqual(ev, other) self.assertNotEqual(ev, other)
# Issue 11973
bignum = 0xffff
ev = select.kevent(0, 1, bignum)
self.assertEqual(ev.ident, 0)
self.assertEqual(ev.filter, 1)
self.assertEqual(ev.flags, bignum)
self.assertEqual(ev.fflags, 0)
self.assertEqual(ev.data, 0)
self.assertEqual(ev.udata, 0)
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
# Issue 11973
bignum = 0xffffffff
ev = select.kevent(0, 1, 2, bignum)
self.assertEqual(ev.ident, 0)
self.assertEqual(ev.filter, 1)
self.assertEqual(ev.flags, 2)
self.assertEqual(ev.fflags, bignum)
self.assertEqual(ev.data, 0)
self.assertEqual(ev.udata, 0)
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
def test_queue_event(self): def test_queue_event(self):
serverSocket = socket.socket() serverSocket = socket.socket()
serverSocket.bind(('127.0.0.1', 0)) serverSocket.bind(('127.0.0.1', 0))