diff options
| author | Facundo Batista <facundobatista@gmail.com> | 2007-03-28 03:45:20 (GMT) |
|---|---|---|
| committer | Facundo Batista <facundobatista@gmail.com> | 2007-03-28 03:45:20 (GMT) |
| commit | 1fe9f968a21843175c3cbd6adf632aa95d2f2bef (patch) | |
| tree | 85658d73283cf4945e086b3b43224265667908c9 /Lib/test/test_socket.py | |
| parent | b20c500251949028d38b32112e864da3cd074be0 (diff) | |
| download | cpython-1fe9f968a21843175c3cbd6adf632aa95d2f2bef.zip cpython-1fe9f968a21843175c3cbd6adf632aa95d2f2bef.tar.gz cpython-1fe9f968a21843175c3cbd6adf632aa95d2f2bef.tar.bz2 | |
Bug 1688393. Adds a control of negative values in
socket.recvfrom, which caused an ugly crash.
Diffstat (limited to 'Lib/test/test_socket.py')
| -rw-r--r-- | Lib/test/test_socket.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 5be3dc3..24d1a5d 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -597,6 +597,13 @@ class BasicUDPTest(ThreadedUDPSocketTest): def _testRecvFrom(self): self.cli.sendto(MSG, 0, (HOST, PORT)) + def testRecvFromNegative(self): + # Negative lengths passed to recvfrom should give ValueError. + self.assertRaises(ValueError, self.serv.recvfrom, -1) + + def _testRecvFromNegative(self): + self.cli.sendto(MSG, 0, (HOST, PORT)) + class TCPCloserTest(ThreadedTCPSocketTest): def testClose(self): |
