Skip to content

Commit

Permalink
variable ctrlr len
Browse files Browse the repository at this point in the history
  • Loading branch information
mileskent committed Sep 29, 2024
1 parent 2efbfff commit fe3ad48
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/test_systems/tc_mux_v2_testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,10 @@ TEST(TorqueControllerMuxTesting, test_null_pointer_error_state)
template<int num_controllers>
void test_with_n_controllers() {
SharedCarState_s state({}, {}, {}, {}, {}, {});
std::array<TestControllerType, num_controllers> controller_instances; // Use std::array instead of std::vector
std::array<Controller*, num_controllers> controller_ptrs; // Use std::array for pointers
std::array<bool, num_controllers> error_flags{}; // Default-initialize to false
std::array<TestControllerType, num_controllers> controller_instances;
std::array<Controller*, num_controllers> controller_ptrs;
std::array<bool, num_controllers> error_flags{};

// Fill the controller pointer array
for (int i = 0; i < num_controllers; ++i) {
controller_ptrs[i] = static_cast<Controller*>(&controller_instances[i]);
}
Expand Down

0 comments on commit fe3ad48

Please sign in to comment.