From 78b841459b01aa755291ff4b1ce0d325865d0f39 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Mon, 1 Nov 2021 15:35:55 +0000 Subject: [PATCH] Fix test This fix is needed for this PR to pass tests https://github.com/ros2/rclcpp/pull/1612 Signed-off-by: Mauro Passerino --- test_rclcpp/test/test_waitable.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_rclcpp/test/test_waitable.cpp b/test_rclcpp/test/test_waitable.cpp index 6c3b043d..ba0f43a5 100644 --- a/test_rclcpp/test/test_waitable.cpp +++ b/test_rclcpp/test/test_waitable.cpp @@ -61,11 +61,13 @@ class WaitableWithTimer : public rclcpp::Waitable return 1u; } - bool + void add_to_wait_set(rcl_wait_set_t * wait_set) override { rcl_ret_t ret = rcl_wait_set_add_timer(wait_set, timer_.get(), &timer_idx_); - return RCL_RET_OK == ret; + if (RCL_RET_OK != ret) { + throw std::runtime_error("failed to add timer to wait set"); + } } bool