From b219ace9b654a96c5c666165fd9662e205558225 Mon Sep 17 00:00:00 2001 From: ivanpauno Date: Thu, 19 Sep 2019 15:56:22 -0300 Subject: [PATCH 1/2] Fix test_graph Signed-off-by: ivanpauno --- rcl_action/test/rcl_action/test_graph.cpp | 31 ++++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/rcl_action/test/rcl_action/test_graph.cpp b/rcl_action/test/rcl_action/test_graph.cpp index 43b66941b..3a6989d64 100644 --- a/rcl_action/test/rcl_action/test_graph.cpp +++ b/rcl_action/test/rcl_action/test_graph.cpp @@ -51,6 +51,7 @@ class CLASSNAME (TestActionGraphFixture, RMW_IMPLEMENTATION) : public ::testing: rcl_node_t zero_node; const char * test_graph_node_name = "test_action_graph_node"; const char * test_graph_old_node_name = "test_action_graph_old_node_name"; + const char * test_graph_unknown_node_name = "test_action_graph_unknown_node_name"; void SetUp() { @@ -132,17 +133,14 @@ TEST_F( rcl_reset_error(); // Invalid node name ret = rcl_action_get_client_names_and_types_by_node( - &this->node, &this->allocator, "_test_this_Isnot_a_valid_name", "", &nat); - EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str; + &this->node, &this->allocator, "_!test_this_is_not_a_valid_name", "", &nat); + EXPECT_EQ(RCL_RET_NODE_INVALID_NAME, ret) << rcl_get_error_string().str; rcl_reset_error(); // Non-existent node - // Note, Opensplice successfully reports graph information about finalized nodes - if (!is_opensplice) { - ret = rcl_action_get_client_names_and_types_by_node( - &this->node, &this->allocator, this->test_graph_old_node_name, "", &nat); - EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str; - rcl_reset_error(); - } + ret = rcl_action_get_client_names_and_types_by_node( + &this->node, &this->allocator, this->test_graph_unknown_node_name, "", &nat); + EXPECT_EQ(RCL_RET_NODE_NAME_NON_EXISTENT, ret) << rcl_get_error_string().str; + rcl_reset_error(); // Invalid names and types ret = rcl_action_get_client_names_and_types_by_node( &this->node, &this->allocator, this->test_graph_node_name, "", nullptr); @@ -188,17 +186,14 @@ TEST_F( rcl_reset_error(); // Invalid node name ret = rcl_action_get_server_names_and_types_by_node( - &this->node, &this->allocator, "_test_this_Isnot_a_valid_name", "", &nat); - EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str; + &this->node, &this->allocator, "_!test_this_is_not_a_valid_name", "", &nat); + EXPECT_EQ(RCL_RET_NODE_INVALID_NAME, ret) << rcl_get_error_string().str; rcl_reset_error(); // Non-existent node - // Note, Opensplice successfully reports graph information about finalized nodes - if (!is_opensplice) { - ret = rcl_action_get_server_names_and_types_by_node( - &this->node, &this->allocator, this->test_graph_old_node_name, "", &nat); - EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str; - rcl_reset_error(); - } + ret = rcl_action_get_server_names_and_types_by_node( + &this->node, &this->allocator, this->test_graph_unknown_node_name, "", &nat); + EXPECT_EQ(RCL_RET_NODE_NAME_NON_EXISTENT, ret) << rcl_get_error_string().str; + rcl_reset_error(); // Invalid names and types ret = rcl_action_get_server_names_and_types_by_node( &this->node, &this->allocator, this->test_graph_node_name, "", nullptr); From 7ee6a9f3e1ce57ea08882c907f4bbcaf662e8186 Mon Sep 17 00:00:00 2001 From: ivanpauno Date: Fri, 20 Sep 2019 09:57:27 -0300 Subject: [PATCH 2/2] Delete is_opensplice variable Signed-off-by: ivanpauno --- rcl_action/test/rcl_action/test_graph.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/rcl_action/test/rcl_action/test_graph.cpp b/rcl_action/test/rcl_action/test_graph.cpp index 3a6989d64..839e75191 100644 --- a/rcl_action/test/rcl_action/test_graph.cpp +++ b/rcl_action/test/rcl_action/test_graph.cpp @@ -36,9 +36,6 @@ # define CLASSNAME(NAME, SUFFIX) NAME #endif -const bool is_opensplice = - std::string(rmw_get_implementation_identifier()).find("rmw_opensplice") == 0; - class CLASSNAME (TestActionGraphFixture, RMW_IMPLEMENTATION) : public ::testing::Test { public: