From d2cbef516e00be18248dc7cdbb2395857f7786b6 Mon Sep 17 00:00:00 2001 From: ivanpauno Date: Thu, 12 Sep 2019 11:12:44 -0700 Subject: [PATCH 1/2] Uncoment some test_graph test cases after fix in rmw_fastrtps Signed-off-by: ivanpauno --- rcl/test/rcl/test_graph.cpp | 54 +++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/rcl/test/rcl/test_graph.cpp b/rcl/test/rcl/test_graph.cpp index 2a6bd1e76..50038a214 100644 --- a/rcl/test/rcl/test_graph.cpp +++ b/rcl/test/rcl/test_graph.cpp @@ -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); @@ -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); @@ -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); @@ -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); @@ -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, 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_service_names_and_types_by_node( this->node_ptr, &allocator, this->test_graph_node_name, "", nullptr); @@ -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); From 0861668ec241887eb76d7aae9d5d255f9c1dbc45 Mon Sep 17 00:00:00 2001 From: ivanpauno Date: Thu, 12 Sep 2019 11:28:17 -0700 Subject: [PATCH 2/2] fix Signed-off-by: ivanpauno --- rcl/test/rcl/test_graph.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rcl/test/rcl/test_graph.cpp b/rcl/test/rcl/test_graph.cpp index 50038a214..bc40cba49 100644 --- a/rcl/test/rcl/test_graph.cpp +++ b/rcl/test/rcl/test_graph.cpp @@ -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( @@ -360,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( @@ -442,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( @@ -485,7 +485,7 @@ TEST_F( 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, false, this->test_graph_node_name, "_!invalidNs", &nat); + 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