diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-03-31 18:56:11 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-03-31 18:56:11 +0000 |
commit | 65407fb7344d4ecdeecb8733831365c23a713ab6 (patch) | |
tree | a9b6176ba4cbda35577e3b437a3ab2732cefde16 /Lib/test/test_socket.py | |
parent | ef9e09e737914c9c5d91cf177df43fdad4be6000 (diff) | |
download | cpython-git-65407fb7344d4ecdeecb8733831365c23a713ab6.tar.gz |
Backport 54594:
Fix SF #1688393, sock.recvfrom(-24) crashes
Also fix some method names that were copied incorrectly (trunk fixed).
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 84f1359f37..b5215214d1 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -583,6 +583,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): |