From b50fd75f8fed8b5e9bcb097cab4f001147f6d759 Mon Sep 17 00:00:00 2001 From: mauropasse Date: Mon, 29 Nov 2021 20:58:57 +0000 Subject: [PATCH] Fix test (#488) This fix is needed for this PR to pass tests https://github.com/ros2/rclcpp/pull/1612 Signed-off-by: Mauro Passerino Co-authored-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