Skip to content

Commit

Permalink
ROS 2 remove obsolate tests in BT (#333)
Browse files Browse the repository at this point in the history
* remove unnecessary tests

* remove unnecessary brackets
  • Loading branch information
KmakD authored Jun 10, 2024
1 parent cd0c334 commit c0b1514
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
2 changes: 1 addition & 1 deletion panther_manager/behavior_trees/lights.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
<Sequence name="BatteryStatusSequence">
<TickAfterTimeout timeout="{LOW_BATTERY_ANIM_PERIOD}"
Expand Down
16 changes: 0 additions & 16 deletions panther_manager/test/plugins/test_call_set_bool_service_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,6 @@ TEST_F(TestCallSetBoolService, WrongSetBoolCallServiceFailure)
EXPECT_EQ(status, BT::NodeStatus::FAILURE);
}

TEST_F(TestCallSetBoolService, WrongServiceValueDefined)
{
std::map<std::string, std::string> service = {
{"service_name", "set_bool"}, {"data", "wrong_bool"}};

using std_srvs::srv::SetBool;
CreateService<SetBool>(
"set_bool",
[&](const SetBool::Request::SharedPtr request, SetBool::Response::SharedPtr response) {
ServiceCallback(request, response, true, true);
});
RegisterNodeWithParams<panther_manager::CallSetBoolService>("CallSetBoolService");

EXPECT_THROW({ CreateTree("CallSetBoolService", service); }, BT::LogicError);
}

int main(int argc, char ** argv)
{
testing::InitGoogleTest(&argc, argv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,6 @@ TEST_F(TestCallSetLedAnimationService, WrongSetLedAnimationCallServiceFailure)
EXPECT_EQ(status, BT::NodeStatus::FAILURE);
}

TEST_F(TestCallSetLedAnimationService, WrongRepeatingServiceValueDefined)
{
std::map<std::string, std::string> service = {
{"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "wrong_bool"}};

RegisterNodeWithParams<panther_manager::CallSetLedAnimationService>("CallSetLedAnimationService");

EXPECT_THROW({ CreateTree("CallSetLedAnimationService", service); }, BT::LogicError);
}

TEST_F(TestCallSetLedAnimationService, WrongIdServiceValueDefined)
{
std::map<std::string, std::string> service = {
{"service_name", "set_led_animation"}, {"id", "-5"}, {"param", ""}, {"repeating", "true"}};

RegisterNodeWithParams<panther_manager::CallSetLedAnimationService>("CallSetLedAnimationService");

EXPECT_THROW({ CreateTree("CallSetLedAnimationService", service); }, BT::LogicError);
}

int main(int argc, char ** argv)
{
testing::InitGoogleTest(&argc, argv);
Expand Down

0 comments on commit c0b1514

Please sign in to comment.