From c0b1514648ee9ccf95d4a10a72a57d2b6c4e147e Mon Sep 17 00:00:00 2001 From: Dawid Kmak <73443304+KmakD@users.noreply.github.com> Date: Mon, 10 Jun 2024 08:33:25 +0200 Subject: [PATCH] ROS 2 remove obsolate tests in BT (#333) * remove unnecessary tests * remove unnecessary brackets --- panther_manager/behavior_trees/lights.xml | 2 +- .../test_call_set_bool_service_node.cpp | 16 --------------- ...st_call_set_led_animation_service_node.cpp | 20 ------------------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/panther_manager/behavior_trees/lights.xml b/panther_manager/behavior_trees/lights.xml index 09bcb1a1e..a4609da72 100644 --- a/panther_manager/behavior_trees/lights.xml +++ b/panther_manager/behavior_trees/lights.xml @@ -49,7 +49,7 @@ current_anim_id = CHARGING_BATTERY_ANIM_ID"/> param="" repeating="true" service_name="lights/controller/set/animation" - _skipIf="(!e_stop_state) || (current_anim_id == E_STOP_ANIM_ID)" + _skipIf="(!e_stop_state) || current_anim_id == E_STOP_ANIM_ID" _onSuccess="current_anim_id = E_STOP_ANIM_ID"/> service = { - {"service_name", "set_bool"}, {"data", "wrong_bool"}}; - - using std_srvs::srv::SetBool; - CreateService( - "set_bool", - [&](const SetBool::Request::SharedPtr request, SetBool::Response::SharedPtr response) { - ServiceCallback(request, response, true, true); - }); - RegisterNodeWithParams("CallSetBoolService"); - - EXPECT_THROW({ CreateTree("CallSetBoolService", service); }, BT::LogicError); -} - int main(int argc, char ** argv) { testing::InitGoogleTest(&argc, argv); diff --git a/panther_manager/test/plugins/test_call_set_led_animation_service_node.cpp b/panther_manager/test/plugins/test_call_set_led_animation_service_node.cpp index 9c2b13a43..03bf01378 100644 --- a/panther_manager/test/plugins/test_call_set_led_animation_service_node.cpp +++ b/panther_manager/test/plugins/test_call_set_led_animation_service_node.cpp @@ -171,26 +171,6 @@ TEST_F(TestCallSetLedAnimationService, WrongSetLedAnimationCallServiceFailure) EXPECT_EQ(status, BT::NodeStatus::FAILURE); } -TEST_F(TestCallSetLedAnimationService, WrongRepeatingServiceValueDefined) -{ - std::map service = { - {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "wrong_bool"}}; - - RegisterNodeWithParams("CallSetLedAnimationService"); - - EXPECT_THROW({ CreateTree("CallSetLedAnimationService", service); }, BT::LogicError); -} - -TEST_F(TestCallSetLedAnimationService, WrongIdServiceValueDefined) -{ - std::map service = { - {"service_name", "set_led_animation"}, {"id", "-5"}, {"param", ""}, {"repeating", "true"}}; - - RegisterNodeWithParams("CallSetLedAnimationService"); - - EXPECT_THROW({ CreateTree("CallSetLedAnimationService", service); }, BT::LogicError); -} - int main(int argc, char ** argv) { testing::InitGoogleTest(&argc, argv);