Skip to content

Commit

Permalink
Change expected rmw GID array size to 16 bytes (#138)
Browse files Browse the repository at this point in the history
The size changed from 24 to 16 bytes in ros2/rmw#345. The same size is
defined in `tracetools`, and it was never updated.

In practice, reading 24-16=8 random extra bytes didn't change much,
since nothing is currently relying on the GID values, at least not
relying on getting the same GID for the same object from two different
systems, because it doesn't work with `rmw_cyclonedds`, see
ros2/rmw_cyclonedds#377.

Signed-off-by: Christophe Bedard <[email protected]>
  • Loading branch information
christophebedard authored Oct 8, 2024
1 parent 57e6ede commit ab920f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test_tracetools/test/test_generic_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_all(self):

for event in rmw_sub_init_events:
self.assertValidHandle(event, ['rmw_subscription_handle'])
self.assertValidStaticArray(event, 'gid', int, 24)
self.assertValidStaticArray(event, 'gid', int, 16)
for event in rcl_sub_init_events:
self.assertValidHandle(
event,
Expand Down
2 changes: 1 addition & 1 deletion test_tracetools/test/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_all(self):
rmw_pub_init_events = self.get_events_with_name(tp.rmw_publisher_init)
for event in rmw_pub_init_events:
self.assertValidHandle(event, ['rmw_publisher_handle'])
self.assertValidStaticArray(event, 'gid', int, 24)
self.assertValidStaticArray(event, 'gid', int, 16)
pub_init_events = self.get_events_with_name(tp.rcl_publisher_init)
for event in pub_init_events:
self.assertValidHandle(
Expand Down
2 changes: 1 addition & 1 deletion test_tracetools/test/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_all(self):

for event in rmw_sub_init_events:
self.assertValidHandle(event, ['rmw_subscription_handle'])
self.assertValidStaticArray(event, 'gid', int, 24)
self.assertValidStaticArray(event, 'gid', int, 16)
for event in rcl_sub_init_events:
self.assertValidHandle(
event,
Expand Down
2 changes: 1 addition & 1 deletion tracetools/include/tracetools/tp_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "tracetools/version.h"

/// See RMW_GID_STORAGE_SIZE in rmw.
#define TRACETOOLS_GID_STORAGE_SIZE 24u
#define TRACETOOLS_GID_STORAGE_SIZE 16u

#ifdef __clang__
# pragma clang diagnostic push
Expand Down

0 comments on commit ab920f0

Please sign in to comment.