Skip to content
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

Fix int32[] and uint32[] 32 bit sequence types only accepting 16 bit sequences #130

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

sloretz
Copy link
Contributor

@sloretz sloretz commented May 22, 2021

I noticed this bug while reviewing #129. There is a bug with the types of int32[] and uint32[] message fields where 32 bit sequences are being stored in types that only accepts 16bit values. The tests look like they're covering this case, but actually they aren't because the comparison of array.array() instances is not intuitive.

array.array() comparisons don't consider typecode

>>> array.array('B') == array.array('f')
True

array.array() comparisons seem to check equality of the sequences they were created with, not the bytes they output

>>> aI =  array.array('I', [0, 1, 4294967295])
>>> aL = array.array('L', [0, 1, 4294967295])
>>> aI == aL
True
>>> aI.tobytes() == aL.tobytes()
False

This should be backported to Foxy and Galactic.

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
@sloretz sloretz added the bug Something isn't working label May 22, 2021
@sloretz sloretz self-assigned this May 22, 2021
@sloretz
Copy link
Contributor Author

sloretz commented May 22, 2021

Full CI to see if fixing the types breaks anything downstream

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor

This is a good catch, but unfortunately CI seems pretty cranky with this change :(.

@audrow audrow changed the base branch from master to rolling June 28, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants