From ab920f07d435668b9ad01ccf4c69758d5db223f0 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 8 Oct 2024 08:07:31 -0700 Subject: [PATCH] Change expected rmw GID array size to 16 bytes (#138) 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 --- test_tracetools/test/test_generic_subscription.py | 2 +- test_tracetools/test/test_publisher.py | 2 +- test_tracetools/test/test_subscription.py | 2 +- tracetools/include/tracetools/tp_call.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test_tracetools/test/test_generic_subscription.py b/test_tracetools/test/test_generic_subscription.py index 8e4545a2..c0241da7 100644 --- a/test_tracetools/test/test_generic_subscription.py +++ b/test_tracetools/test/test_generic_subscription.py @@ -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, diff --git a/test_tracetools/test/test_publisher.py b/test_tracetools/test/test_publisher.py index 4d9e1666..c3ce86e8 100644 --- a/test_tracetools/test/test_publisher.py +++ b/test_tracetools/test/test_publisher.py @@ -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( diff --git a/test_tracetools/test/test_subscription.py b/test_tracetools/test/test_subscription.py index 77dd6c07..483e4bf0 100644 --- a/test_tracetools/test/test_subscription.py +++ b/test_tracetools/test/test_subscription.py @@ -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, diff --git a/tracetools/include/tracetools/tp_call.h b/tracetools/include/tracetools/tp_call.h index c56dc1b4..0b63de14 100644 --- a/tracetools/include/tracetools/tp_call.h +++ b/tracetools/include/tracetools/tp_call.h @@ -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