From 2615b0e8a5e3d9188e50412337e3b306991b05a6 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 14 Nov 2024 09:55:45 -0500 Subject: [PATCH] Make the event skipping more generic. (#1197) That is, don't hard-code rmw_zenoh_cpp if we can avoid it. Instead, check if the middleware in question supports the events, and only skip the test if it does not. Signed-off-by: Chris Lalancette --- rcl/test/rcl/test_events.cpp | 125 ++++++++++++++++++++++------------- 1 file changed, 80 insertions(+), 45 deletions(-) diff --git a/rcl/test/rcl/test_events.cpp b/rcl/test/rcl/test_events.cpp index 941198eb1..74aa438f4 100644 --- a/rcl/test/rcl/test_events.cpp +++ b/rcl/test/rcl/test_events.cpp @@ -43,8 +43,6 @@ constexpr seconds LIVELINESS_LEASE_DURATION_IN_S = 1s; constexpr seconds DEADLINE_PERIOD_IN_S = 2s; constexpr seconds MAX_WAIT_PER_TESTCASE = 10s; -#define EXPECT_OK(varname) EXPECT_EQ(varname, RCL_RET_OK) << rcl_get_error_string().str - struct TestIncompatibleQosEventParams { std::string testcase_name; @@ -122,10 +120,14 @@ class TestEventFixture : public ::testing::TestWithParamnode_ptr); + EXPECT_EQ(fail_ret, RCL_RET_OK) << rcl_get_error_string().str; + ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str; + } } - void setup_publisher_subscription_events( + rcl_ret_t setup_publisher_subscription_events( const rcl_publisher_event_type_t & pub_event_type, const rcl_subscription_event_type_t & sub_event_type) { @@ -134,22 +136,35 @@ class TestEventFixture : public ::testing::TestWithParam