From f49e86f2059d10ae1ffe5991ce1d68d9e109b234 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Wed, 3 Apr 2024 16:24:05 -0700 Subject: [PATCH] style Signed-off-by: William Woodall --- .../rclcpp/strategies/test_allocator_memory_strategy.cpp | 1 - .../wait_set_policies/test_storage_policy_common.cpp | 1 - .../test/rclcpp/waitables/test_intra_process_waitable.cpp | 8 ++++---- rclcpp/test/rclcpp/waitables/waitable_test_helpers.hpp | 8 ++++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/rclcpp/test/rclcpp/strategies/test_allocator_memory_strategy.cpp b/rclcpp/test/rclcpp/strategies/test_allocator_memory_strategy.cpp index b32541b76f..452228645b 100644 --- a/rclcpp/test/rclcpp/strategies/test_allocator_memory_strategy.cpp +++ b/rclcpp/test/rclcpp/strategies/test_allocator_memory_strategy.cpp @@ -40,7 +40,6 @@ class TestWaitable : public rclcpp::Waitable { public: void add_to_wait_set(rcl_wait_set_t &) override - { if (!test_waitable_result) { throw std::runtime_error("TestWaitable add_to_wait_set failed"); diff --git a/rclcpp/test/rclcpp/wait_set_policies/test_storage_policy_common.cpp b/rclcpp/test/rclcpp/wait_set_policies/test_storage_policy_common.cpp index a1b5b5dfbd..eaf3a866d1 100644 --- a/rclcpp/test/rclcpp/wait_set_policies/test_storage_policy_common.cpp +++ b/rclcpp/test/rclcpp/wait_set_policies/test_storage_policy_common.cpp @@ -52,7 +52,6 @@ class TestWaitable : public rclcpp::Waitable : is_ready_(false), add_to_wait_set_(false) {} void add_to_wait_set(rcl_wait_set_t &) override - { if (!add_to_wait_set_) { throw std::runtime_error("waitable unexpectedly failed to be added to wait set"); diff --git a/rclcpp/test/rclcpp/waitables/test_intra_process_waitable.cpp b/rclcpp/test/rclcpp/waitables/test_intra_process_waitable.cpp index 367adf705a..723e80513b 100644 --- a/rclcpp/test/rclcpp/waitables/test_intra_process_waitable.cpp +++ b/rclcpp/test/rclcpp/waitables/test_intra_process_waitable.cpp @@ -22,8 +22,8 @@ class TestIntraProcessWaitable : public ::testing::Test { protected: - static void SetUpTestCase() { rclcpp::init(0, nullptr); } - static void TearDownTestCase() { rclcpp::shutdown(); } + static void SetUpTestCase() {rclcpp::init(0, nullptr);} + static void TearDownTestCase() {rclcpp::shutdown();} }; TEST_F(TestIntraProcessWaitable, test_that_waitable_stays_ready_after_second_wait) { @@ -36,8 +36,8 @@ TEST_F(TestIntraProcessWaitable, test_that_waitable_stays_ready_after_second_wai auto pub = node->create_publisher("test_topic", 10); auto make_sub_intra_process_waitable_ready = [pub]() { - pub->publish(Empty()); - }; + pub->publish(Empty()); + }; rclcpp::test::waitables::do_test_that_waitable_stays_ready_after_second_wait( sub->get_intra_process_waitable(), diff --git a/rclcpp/test/rclcpp/waitables/waitable_test_helpers.hpp b/rclcpp/test/rclcpp/waitables/waitable_test_helpers.hpp index 526f49a0af..49e074d5b0 100644 --- a/rclcpp/test/rclcpp/waitables/waitable_test_helpers.hpp +++ b/rclcpp/test/rclcpp/waitables/waitable_test_helpers.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef RCLCPP__TEST__RCLCPP__WAITABLES__WAITABLE_TEST_HELPERS_HPP_ -#define RCLCPP__TEST__RCLCPP__WAITABLES__WAITABLE_TEST_HELPERS_HPP_ +#ifndef RCLCPP__WAITABLES__WAITABLE_TEST_HELPERS_HPP_ +#define RCLCPP__WAITABLES__WAITABLE_TEST_HELPERS_HPP_ #include @@ -104,7 +104,7 @@ do_test_that_waitable_stays_ready_after_second_wait( waitable->execute(waitable->take_data()); auto wait_result = wait_set.wait(std::chrono::seconds(0)); EXPECT_EQ(wait_result.kind(), rclcpp::WaitResultKind::Timeout) - << "wait set did not time out after the waitable should have no longer been ready"; + << "wait set did not time out after the waitable should have no longer been ready"; EXPECT_FALSE(waitable->is_ready(wait_set.get_rcl_wait_set())) << "waitable was unexpectedly ready after a take_data and execute"; } @@ -114,4 +114,4 @@ do_test_that_waitable_stays_ready_after_second_wait( } // namespace test } // namespace rclcpp -#endif // RCLCPP__TEST__RCLCPP__WAITABLES__WAITABLE_TEST_HELPERS_HPP_ +#endif // RCLCPP__WAITABLES__WAITABLE_TEST_HELPERS_HPP_