Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions rcl_action/test/rcl_action/test_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -51,6 +48,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()
{
Expand Down Expand Up @@ -132,17 +130,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);
&this->node, &this->allocator, "_!test_this_is_not_a_valid_name", "", &nat);
EXPECT_EQ(RCL_RET_ERROR, 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_ERROR, 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);
Expand Down Expand Up @@ -188,17 +183,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);
&this->node, &this->allocator, "_!test_this_is_not_a_valid_name", "", &nat);
EXPECT_EQ(RCL_RET_ERROR, 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_ERROR, 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);
Expand Down