Skip to content

Commit

Permalink
used wrong ctr manager in some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Comerm28 committed Nov 14, 2024
1 parent 5475256 commit 8ca9209
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions unit_test/test_controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ TEST_F(ControllerManagerTest, StepActiveSpeedController) {
//swap between same controller outputs
TEST_F(ControllerManagerTest, SwapSameTypes) {
vehicle_state.current_rpms = {100, 100, 100, 100};
ASSERT_TRUE(controller_manager_2speed.swap_active_controller(2, vehicle_state));
ASSERT_FALSE(controller_manager_diff.swap_active_controller(2, vehicle_state));

core::ControllerOutput output = controller_manager_2speed.step_active_controller(vehicle_state);
core::ControllerOutput output = controller_manager_diff.step_active_controller(vehicle_state);
ASSERT_TRUE(std::holds_alternative<core::SpeedControlOut>(output.out));
}

Expand All @@ -136,13 +136,13 @@ TEST_F(ControllerManagerTest, SwapBetweenTypes) {
ASSERT_TRUE(std::holds_alternative<core::SpeedControlOut>(output.out));
}

//switching with different controllers where desired
//switching where kachow
TEST_F(ControllerManagerTest, SwapSpeedTooHigh) {
vehicle_state.current_rpms = {10000, 10000, 10000, 10000};
ASSERT_FALSE(controller_manager_2speed.swap_active_controller(1, vehicle_state));
ASSERT_FALSE(controller_manager_diff.swap_active_controller(1, vehicle_state));

core::ControllerOutput output = controller_manager_2speed.step_active_controller(vehicle_state);
ASSERT_TRUE(std::holds_alternative<core::TorqueControlOut>(output.out));
core::ControllerOutput output = controller_manager_diff.step_active_controller(vehicle_state);
ASSERT_TRUE(std::holds_alternative<core::SpeedControlOut>(output.out));
}

// Test out of range index
Expand Down

0 comments on commit 8ca9209

Please sign in to comment.