-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests fail on bigendian #1624
Comments
test_btr_persistencepython-can/test/test_bit_timing.py Lines 177 to 178 in dc0ae68
on BigEndian, this really returns Is the assumption of the byte-ordering broken in the test (as is indicated by the naming of the variables), or should |
That part can probably be solved with a for btr0btr1 in PCAN_BITRATES.values():
btr1, btr0 = struct.unpack("<BB", btr0btr1) But the |
now really (in my tests). btr0, btr1 = struct.pack(">H", btr0btr1.value) (which also looks more correct, as the value of |
Sounds good to me, would you create a PR? |
sure. any ideas about the other issue? Lines 381 to 385 in dc0ae68
see also #1412 |
generating the data with the native endianness solves the second issue: data=struct.pack("HBBI33sII", 81, 5, 0, 1, b'PCAN-USB FD', 1122867, 1)
value = (TPCANChannelInformation * 1).from_buffer_copy(data) @zariiii9003 does this look good to you? |
PCAN_BITRATES are stored in BIGendian, no use to byteswap on littleendian. Also the TPCANChannelInformation expects data in the native byte order Closes: hardbyte#1624
PCAN_BITRATES are stored in BIGendian, no use to byteswap on littleendian. Also the TPCANChannelInformation expects data in the native byte order Closes: hardbyte#1624
PCAN_BITRATES are stored in BIGendian, no use to byteswap on littleendian. Also the TPCANChannelInformation expects data in the native byte order Closes: #1624 Co-authored-by: IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>
Describe the bug
Running the test-suite on a BingEndian architecture (like
s390x
), fails in two places:To Reproduce
Run the test-suite on a BigEndian machine
Expected behavior
tests should succeed, regardless of endianness
Additional context
The text was updated successfully, but these errors were encountered: