mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Fixes in struct and socket from merge reviews.
- Following Guido's comments, renamed * pack_to -> pack_into * recv_buf -> recv_into * recvfrom_buf -> recvfrom_into - Made fixes to _struct.c according to Neal Norwitz comments on the checkins list. - Converted some ints into the appropriate -- I hope -- ssize_t and size_t.
This commit is contained in:
parent
63f0db682e
commit
af2ae72cb2
6 changed files with 75 additions and 74 deletions
|
@ -860,25 +860,25 @@ class BufferIOTest(SocketConnectedTest):
|
|||
def __init__(self, methodName='runTest'):
|
||||
SocketConnectedTest.__init__(self, methodName=methodName)
|
||||
|
||||
def testRecvBuf(self):
|
||||
def testRecvInto(self):
|
||||
buf = array.array('c', ' '*1024)
|
||||
nbytes = self.cli_conn.recv_buf(buf)
|
||||
nbytes = self.cli_conn.recv_into(buf)
|
||||
self.assertEqual(nbytes, len(MSG))
|
||||
msg = buf.tostring()[:len(MSG)]
|
||||
self.assertEqual(msg, MSG)
|
||||
|
||||
def _testRecvBuf(self):
|
||||
def _testRecvInto(self):
|
||||
buf = buffer(MSG)
|
||||
self.serv_conn.send(buf)
|
||||
|
||||
def testRecvFromBuf(self):
|
||||
def testRecvFromInto(self):
|
||||
buf = array.array('c', ' '*1024)
|
||||
nbytes, addr = self.cli_conn.recvfrom_buf(buf)
|
||||
nbytes, addr = self.cli_conn.recvfrom_into(buf)
|
||||
self.assertEqual(nbytes, len(MSG))
|
||||
msg = buf.tostring()[:len(MSG)]
|
||||
self.assertEqual(msg, MSG)
|
||||
|
||||
def _testRecvFromBuf(self):
|
||||
def _testRecvFromInto(self):
|
||||
buf = buffer(MSG)
|
||||
self.serv_conn.send(buf)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue