From 1ab674449fd5250a8b0cad1eabbbd0c23356975d Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Wed, 26 Jun 2019 14:05:39 -0700 Subject: [PATCH 1/2] Remove tests about FastRTPS not supporting MANUAL_BY_TOPIC liveliness Signed-off-by: Emerson Knapp --- rcl/test/rcl/test_events.cpp | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/rcl/test/rcl/test_events.cpp b/rcl/test/rcl/test_events.cpp index c7d52ad62..472848695 100644 --- a/rcl/test/rcl/test_events.cpp +++ b/rcl/test/rcl/test_events.cpp @@ -52,7 +52,7 @@ class CLASSNAME (TestEventFixture, RMW_IMPLEMENTATION) : public ::testing::Test { is_opensplice = (std::string(rmw_get_implementation_identifier()).find("rmw_opensplice") == 0); bool is_fastrtps = (std::string(rmw_get_implementation_identifier()).find("rmw_fastrtps") == 0); - is_liveliness_supported = !is_fastrtps; + is_manual_by_node_liveliness_supported = !is_fastrtps; rcl_ret_t ret; { @@ -130,13 +130,7 @@ class CLASSNAME (TestEventFixture, RMW_IMPLEMENTATION) : public ::testing::Test rmw_time_t lifespan {0, 0}; rmw_time_t deadline {DEADLINE_PERIOD_IN_S.count(), 0}; rmw_time_t lease_duration {LIVELINESS_LEASE_DURATION_IN_S.count(), 0}; - if (!is_liveliness_supported) { - lease_duration = {0, 0}; - } - rmw_qos_liveliness_policy_t liveliness_policy = - is_liveliness_supported ? - RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC : - RMW_QOS_POLICY_LIVELINESS_AUTOMATIC; + rmw_qos_liveliness_policy_t liveliness_policy = RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC; // init publisher ret = setup_publisher(deadline, lifespan, lease_duration, liveliness_policy); @@ -218,7 +212,7 @@ class CLASSNAME (TestEventFixture, RMW_IMPLEMENTATION) : public ::testing::Test rcl_subscription_t subscription; rcl_event_t subscription_event; bool is_opensplice; - bool is_liveliness_supported; + bool is_manual_by_node_liveliness_supported; const char * topic = "rcl_test_publisher_subscription_events"; const rosidl_message_type_support_t * ts; }; @@ -350,7 +344,7 @@ conditional_wait_for_msgs_and_events( } TEST_F(CLASSNAME(TestEventFixture, RMW_IMPLEMENTATION), test_unsupported_liveliness) { - if (is_liveliness_supported) { + if (is_manual_by_node_liveliness_supported) { return; } rmw_time_t deadline {0, 0}; @@ -364,22 +358,6 @@ TEST_F(CLASSNAME(TestEventFixture, RMW_IMPLEMENTATION), test_unsupported_livelin EXPECT_EQ(RCL_RET_ERROR, setup_publisher(deadline, lifespan, lease_duration, liveliness_policy)) << "Initialized publisher with RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE when unsupported"; - - liveliness_policy = RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC; - EXPECT_EQ(RCL_RET_ERROR, - setup_subscriber(deadline, lifespan, lease_duration, liveliness_policy)) << - "Initialized subscription with RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC when unsupported"; - EXPECT_EQ(RCL_RET_ERROR, - setup_publisher(deadline, lifespan, lease_duration, liveliness_policy)) << - "Initialized publisher with RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC when unsupported"; - - liveliness_policy = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC; - EXPECT_EQ(RCL_RET_ERROR, - setup_subscriber(deadline, lifespan, nonzero_lease_duration, liveliness_policy)) << - "Initialized subscription with nonzero Liveliness lease duration when unsupported"; - EXPECT_EQ(RCL_RET_ERROR, - setup_publisher(deadline, lifespan, nonzero_lease_duration, liveliness_policy)) << - "Initialized publisher with nonzero Liveliness lease duration when unsupported"; } /* @@ -522,10 +500,6 @@ TEST_F(CLASSNAME(TestEventFixture, RMW_IMPLEMENTATION), test_pubsub_deadline_mis */ TEST_F(CLASSNAME(TestEventFixture, RMW_IMPLEMENTATION), test_pubsub_liveliness_kill_pub) { - if (!is_liveliness_supported) { - return; - } - setup_publisher_and_subscriber(RCL_PUBLISHER_LIVELINESS_LOST, RCL_SUBSCRIPTION_LIVELINESS_CHANGED); rcl_ret_t ret; From 88049fb985d0665fc92aab5faa5dd218e065ea85 Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Wed, 26 Jun 2019 14:07:25 -0700 Subject: [PATCH 2/2] Remove unused variable Signed-off-by: Emerson Knapp --- rcl/test/rcl/test_events.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/rcl/test/rcl/test_events.cpp b/rcl/test/rcl/test_events.cpp index 472848695..560e716cc 100644 --- a/rcl/test/rcl/test_events.cpp +++ b/rcl/test/rcl/test_events.cpp @@ -350,7 +350,6 @@ TEST_F(CLASSNAME(TestEventFixture, RMW_IMPLEMENTATION), test_unsupported_livelin rmw_time_t deadline {0, 0}; rmw_time_t lifespan {0, 0}; rmw_time_t lease_duration {0, 0}; - rmw_time_t nonzero_lease_duration {1, 0}; rmw_qos_liveliness_policy_t liveliness_policy = RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE; EXPECT_EQ(RCL_RET_ERROR, setup_subscriber(deadline, lifespan, lease_duration, liveliness_policy)) <<