summaryrefslogtreecommitdiff
path: root/Lib/test/test_multiprocessing.py
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2009-01-19 15:12:22 +0000
committerJesse Noller <jnoller@gmail.com>2009-01-19 15:12:22 +0000
commit9a5b2ad38d605206f05a52fe32868d3f839e8a86 (patch)
tree8dd72269c71a0e279ebc7b3d71f879ab89dd05c5 /Lib/test/test_multiprocessing.py
parent273c1d9a8ba2d7dbd03afec7e7d6aadcb884e758 (diff)
downloadcpython-git-9a5b2ad38d605206f05a52fe32868d3f839e8a86.tar.gz
Resolve issue 3321: (segfault) _multiprocessing.Connection() doesn't check handle
Diffstat (limited to 'Lib/test/test_multiprocessing.py')
-rw-r--r--Lib/test/test_multiprocessing.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 2daff7edfd..d4ce4fa2fe 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -61,6 +61,8 @@ else:
HAVE_GETVALUE = not getattr(_multiprocessing,
'HAVE_BROKEN_SEM_GETVALUE', False)
+WIN32 = (sys.platform == "win32")
+
#
# Creates a wrapper for a function which records the time it takes to finish
#
@@ -1682,6 +1684,18 @@ class _TestLogging(BaseTestCase):
logger.setLevel(level=LOG_LEVEL)
#
+# Test to verify handle verification, see issue 3321
+#
+
+class TestInvalidHandle(unittest.TestCase):
+
+ def test_invalid_handles(self):
+ if WIN32:
+ return
+ conn = _multiprocessing.Connection(44977608)
+ self.assertRaises(IOError, conn.poll)
+ self.assertRaises(IOError, _multiprocessing.Connection, -1)
+#
# Functions used to create test cases from the base ones in this module
#
@@ -1785,7 +1799,7 @@ class OtherTest(unittest.TestCase):
multiprocessing.connection.answer_challenge,
_FakeConnection(), b'abc')
-testcases_other = [OtherTest]
+testcases_other = [OtherTest, TestInvalidHandle]
#
#