Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncoment some test_graph test cases after fix in rmw_fastrtps (ros2/rmw_fastrtps#316) #498

Merged
merged 2 commits into from
Sep 12, 2019
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
60 changes: 27 additions & 33 deletions rcl/test/rcl/test_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ TEST_F(
rcutils_get_zero_initialized_allocator());
rcl_node_t zero_node = rcl_get_zero_initialized_node();
const char * unknown_node_name = "/test_rcl_get_publisher_names_and_types_by_node";
// const char * unknown_node_ns = "/test/namespace";
const char * unknown_node_ns = "/test/namespace";
rcl_names_and_types_t nat = rcl_get_zero_initialized_names_and_types();
// invalid node
ret = rcl_get_publisher_names_and_types_by_node(
Expand Down Expand Up @@ -317,11 +317,10 @@ TEST_F(
this->node_ptr, &allocator, false, "_InvalidNodeName", "", &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// TODO(jacobperron): This succeeds, but should fail due to invalid namespace
// ret = rcl_get_publisher_names_and_types_by_node(
// this->node_ptr, &allocator, false, this->test_graph_node_name, "_!invalidNs", &nat);
// EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
// rcl_reset_error();
ret = rcl_get_publisher_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, "_!invalidNs", &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// invalid names and types
ret = rcl_get_publisher_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, "", nullptr);
Expand All @@ -333,11 +332,10 @@ TEST_F(
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// unknown node namespace
// TODO(jacobperron): This succeeds, but should fail due to invalid namespace
// ret = rcl_get_publisher_names_and_types_by_node(
// this->node_ptr, &allocator, false, this->test_graph_node_name, unknown_node_ns, &nat);
// EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
// rcl_reset_error();
ret = rcl_get_publisher_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, unknown_node_ns, &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// valid call
ret = rcl_get_publisher_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, "", &nat);
Expand All @@ -362,7 +360,7 @@ TEST_F(
rcutils_get_zero_initialized_allocator());
rcl_node_t zero_node = rcl_get_zero_initialized_node();
const char * unknown_node_name = "/test_rcl_get_subscriber_names_and_types_by_node";
// const char * unknown_node_ns = "/test/namespace";
const char * unknown_node_ns = "/test/namespace";
rcl_names_and_types_t nat = rcl_get_zero_initialized_names_and_types();
// invalid node
ret = rcl_get_subscriber_names_and_types_by_node(
Expand Down Expand Up @@ -404,11 +402,10 @@ TEST_F(
this->node_ptr, &allocator, false, "_InvalidNodeName", "", &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// TODO(jacobperron): This succeeds, but should fail due to invalid namespace
// ret = rcl_get_subscriber_names_and_types_by_node(
// this->node_ptr, &allocator, false, this->test_graph_node_name, "_!invalidNs", &nat);
// EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
// rcl_reset_error();
ret = rcl_get_subscriber_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, "_!invalidNs", &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// invalid names and types
ret = rcl_get_subscriber_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, "", nullptr);
Expand All @@ -420,11 +417,10 @@ TEST_F(
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// unknown node namespace
// TODO(jacobperron): This succeeds, but should fail due to invalid namespace
// ret = rcl_get_subscriber_names_and_types_by_node(
// this->node_ptr, &allocator, false, this->test_graph_node_name, unknown_node_ns, &nat);
// EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
// rcl_reset_error();
ret = rcl_get_subscriber_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, unknown_node_ns, &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// valid call
ret = rcl_get_subscriber_names_and_types_by_node(
this->node_ptr, &allocator, false, this->test_graph_node_name, "", &nat);
Expand All @@ -446,7 +442,7 @@ TEST_F(
rcutils_get_zero_initialized_allocator());
rcl_node_t zero_node = rcl_get_zero_initialized_node();
const char * unknown_node_name = "/test_rcl_get_service_names_and_types_by_node";
// const char * unknown_node_ns = "/test/namespace";
const char * unknown_node_ns = "/test/namespace";
rcl_names_and_types_t nat = rcl_get_zero_initialized_names_and_types();
// invalid node
ret = rcl_get_service_names_and_types_by_node(
Expand Down Expand Up @@ -488,11 +484,10 @@ TEST_F(
this->node_ptr, &allocator, "_InvalidNodeName", "", &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// TODO(jacobperron): This succeeds, but should fail due to invalid namespace
// ret = rcl_get_service_names_and_types_by_node(
// this->node_ptr, &allocator, false, this->test_graph_node_name, "_!invalidNs", &nat);
// EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
// rcl_reset_error();
ret = rcl_get_service_names_and_types_by_node(
this->node_ptr, &allocator, this->test_graph_node_name, "_!invalidNs", &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// invalid names and types
ret = rcl_get_service_names_and_types_by_node(
this->node_ptr, &allocator, this->test_graph_node_name, "", nullptr);
Expand All @@ -504,11 +499,10 @@ TEST_F(
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// unknown node namespace
// TODO(jacobperron): This succeeds, but should fail due to invalid namespace
// ret = rcl_get_service_names_and_types_by_node(
// this->node_ptr, &allocator, this->test_graph_node_name, unknown_node_ns, &nat);
// EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
// rcl_reset_error();
ret = rcl_get_service_names_and_types_by_node(
this->node_ptr, &allocator, this->test_graph_node_name, unknown_node_ns, &nat);
EXPECT_EQ(RCL_RET_ERROR, ret) << rcl_get_error_string().str;
rcl_reset_error();
// valid call
ret = rcl_get_service_names_and_types_by_node(
this->node_ptr, &allocator, this->test_graph_node_name, "", &nat);
Expand Down