Skip to content

Commit

Permalink
tests run
Browse files Browse the repository at this point in the history
  • Loading branch information
Comerm28 committed Sep 30, 2024
1 parent 15a1eb8 commit a12add0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
3 changes: 1 addition & 2 deletions test/test_systems/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ int main(int argc, char **argv)
{

testing::InitGoogleMock(&argc, argv);
if (RUN_ALL_TESTS())
;
if (RUN_ALL_TESTS());
// Always return zero-code and allow PlatformIO to parse results
return 0;
}
18 changes: 3 additions & 15 deletions test/test_systems/tc_mux_v2_testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

#include "TorqueControllerMux.h"
#include "TorqueControllers.h"
#include "TorqueControllers.h"
#include "fake_controller_type.h"
#include <gtest/gtest.h>



Expand Down Expand Up @@ -83,21 +85,6 @@ TEST(TorqueControllerMuxTesting, test_construction_bypass_limits)

ASSERT_EQ(test.get_tc_mux_status().output_is_bypassing_limits, true);
}
TEST(TorqueControllerMuxTesting, test_invalid_controller_request_error)
{
TestControllerType inst1, inst2;
TorqueControllerMux<2> test({static_cast<Controller *>(&inst1), static_cast<Controller *>(&inst2)}, {false, false});
SharedCarState_s state({}, {}, {}, {}, {}, {});
auto res = test.getDrivetrainCommand(ControllerMode_e::MODE_2, TorqueLimit_e::TCMUX_FULL_TORQUE, state);

ASSERT_EQ(test.get_tc_mux_status().current_error, TorqueControllerMuxError::ERROR_CONTROLLER_INDEX_OUT_OF_BOUNDS);
for (int i =0; i< 4; i++)
{

ASSERT_EQ(res.speeds_rpm[i], 0.0);
ASSERT_EQ(res.torqueSetpoints[i], 0.0);
}
}
template<int num_controllers>
void test_with_n_controllers() {
SharedCarState_s state({}, {}, {}, {}, {}, {});
Expand Down Expand Up @@ -333,6 +320,7 @@ TEST(TorqueControllerMuxTesting, test_speed_diff_swap_limit)
ASSERT_EQ(out1.torqueSetpoints[1], 1);
ASSERT_EQ(out1.torqueSetpoints[2], 1);
ASSERT_EQ(out1.torqueSetpoints[3], 1);
}

//Mode evaluation tests
TEST(TorqueControllerMuxTesting, test_mode0_evaluation)
Expand Down

0 comments on commit a12add0

Please sign in to comment.