Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(269360)

#15359: Sockets support for CAN_BCM

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 1 month ago by hardbyte
Modified:
6 years, 7 months ago
Reviewers:
cf.natali
CC:
AntoinePitrou, Brian, Charles-François Natali, tshepang, devnull_psf.upfronthosting.co.za
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 10

Patch Set 3 #

Patch Set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
configure.ac View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
Doc/library/socket.rst View 1 2 3 4 chunks +27 lines, -5 lines 0 comments Download
Lib/test/test_socket.py View 1 2 3 4 chunks +94 lines, -11 lines 0 comments Download
Modules/socketmodule.c View 1 2 3 2 chunks +17 lines, -0 lines 0 comments Download
Modules/socketmodule.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 2
Charles-François Natali
Here's a review. The test is fine (except for the missing padding and size/alignment issue, ...
6 years, 7 months ago #1
Brian
6 years, 7 months ago #2
http://bugs.python.org/review/15359/diff/7130/Lib/test/test_socket.py
File Lib/test/test_socket.py (right):

http://bugs.python.org/review/15359/diff/7130/Lib/test/test_socket.py#newcode...
Lib/test/test_socket.py:1393: 
On 2013/01/16 22:28:42, Charles-François Natali wrote:
> You must skip this test is CAN sockets are not supported:
> """
> @unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.')
> @unittest.skipUnless(thread, 'Threading required for this test.')
> """
I've removed this class. It had inherited from CANTest so functionally this
already works. Is it necessary just for code readability? I notice all the
skipUnless threading could be refactored into two places too.

http://bugs.python.org/review/15359/diff/7130/Lib/test/test_socket.py#newcode...
Lib/test/test_socket.py:1431: """Must use native not standard types for packing
On 2013/01/16 22:28:42, Charles-François Natali wrote:
> You should move the comment and the struct format in the class definition
before
> the methods.

Done.

http://bugs.python.org/review/15359/diff/7130/Lib/test/test_socket.py#newcode...
Lib/test/test_socket.py:1443: bcm_cmd_msg_fmt = "@IIIllllII"
On 2013/01/16 22:28:42, Charles-François Natali wrote:
> I got a deadlock during the test, because sending on the BCM socket returned
> EINVAL.
> The problem is that the struct definition uses the zero-length array trick,
but
> on my box sizeof(struct bcm_msg_head) returns 40 instead of 36, because
> can_frame must be 8 bytes aligned (data field).
> 
> So in short, I think the format should be:
> "=IIIllllII4x"
> 
> '=' because you want native endianess, but standard size and alignment.

Hmm using a format of "=IIIllllII4x" causes the test to fail on my box. We will
need to rethink this further.

http://bugs.python.org/review/15359/diff/7130/Lib/test/test_socket.py#newcode...
Lib/test/test_socket.py:4887: """
On 2013/01/16 22:28:42, Charles-François Natali wrote:
> What's this?

My mistake, I just commented out the other tests while developing.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+