Skip to content

Commit

Permalink
Make the test of graph users more robust. (#1504)
Browse files Browse the repository at this point in the history
In particular, we don't know for sure that the graph will only
have 1 user; we just know that it should have *at least* one
user.  So change that check to be more robust.  This also
lets us get rid of the slightly strange call to 'notify_graph_change'
that was being used to cleanup graph users.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette committed Jan 6, 2021
1 parent 5821361 commit 85c32a9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ class TestNodeGraph : public ::testing::Test
EXPECT_NO_THROW(node()->wait_for_graph_change(event, timeout));
}

// Run notify_graph_change() here to remove the graph_event users we created
// in the loop above.
node_graph_->notify_graph_change();

return num_things;
}

Expand Down Expand Up @@ -132,7 +128,7 @@ TEST_F(TestNodeGraph, construct_from_node)

// get_graph_event is non-const
EXPECT_NE(nullptr, node()->get_node_graph_interface()->get_graph_event());
EXPECT_EQ(1u, node_graph()->count_graph_users());
EXPECT_LE(1u, node_graph()->count_graph_users());
}

TEST_F(TestNodeGraph, get_topic_names_and_types)
Expand Down

0 comments on commit 85c32a9

Please sign in to comment.