From 90f7afda613fcdc01310b86ca6fe6bcfb8ffca83 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Sun, 12 Oct 2014 12:39:46 -0400 Subject: [PATCH] #11973: add test for previously fixed kevent signed/unsigned bug. Patch by David Naylor. --- Lib/test/test_kqueue.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py index bafdeba6ff1..f79bd8978c1 100644 --- a/Lib/test/test_kqueue.py +++ b/Lib/test/test_kqueue.py @@ -86,6 +86,31 @@ class TestKQueue(unittest.TestCase): self.assertEqual(ev, ev) 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): serverSocket = socket.socket() serverSocket.bind(('127.0.0.1', 0))