Skip to content

Commit

Permalink
fix TestServerGoalHandle.cancel unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Kaven Yau <kavenyau@foxmail.com>
  • Loading branch information
KavenYau committed Apr 26, 2021
1 parent 07bef7b commit 39b0bdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rclcpp_action/test/test_server_goal_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FibonacciServerGoalHandle

bool try_cancel() {return try_canceling();}

void cancel_goal() {_cancel_goal();}
bool cancel_goal() {return _cancel_goal();}
};

class TestServerGoalHandle : public ::testing::Test
Expand Down Expand Up @@ -110,7 +110,7 @@ TEST_F(TestServerGoalHandle, cancel) {
auto mock_is_cancelable = mocking_utils::patch_and_return(
"lib:rclcpp_action", rcl_action_goal_handle_is_cancelable, true);
EXPECT_FALSE(handle_->try_cancel());
EXPECT_THROW(handle_->cancel_goal(), rclcpp::exceptions::RCLError);
EXPECT_FALSE(handle_->cancel_goal());

test_msgs::action::Fibonacci::Result::SharedPtr result =
std::make_shared<test_msgs::action::Fibonacci::Result>();
Expand Down

0 comments on commit 39b0bdc

Please sign in to comment.