Skip to content

Commit

Permalink
added test files
Browse files Browse the repository at this point in the history
  • Loading branch information
RCMast3r committed Jan 30, 2024
1 parent 229c40f commit 343e806
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions test/controller_mux_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifndef CONTROLLER_MUX_TEST
#define CONTROLLER_MUX_TEST


#endif /* CONTROLLER_MUX_TEST */
5 changes: 5 additions & 0 deletions test/drivetrain_system_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifndef DRIVETRAIN_SYSTEM_TEST
#define DRIVETRAIN_SYSTEM_TEST


#endif /* DRIVETRAIN_SYSTEM_TEST */
2 changes: 1 addition & 1 deletion test/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <gtest/gtest.h>

#include "state_machine_test.h"
// #include "pedals_system_test.h"
#include "pedals_system_test.h"



Expand Down
5 changes: 3 additions & 2 deletions test/pedals_system_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ author: Lucas Plant

#ifndef PEDALS_SYSTEM_TEST
#define PEDALS_SYSTEM_TEST
#include <gtest/gtest.h>
#include <string>
#include "PedalsSystem.h"
#include <array>
Expand All @@ -25,7 +26,7 @@ struct PedalIsActiveTestCase



void test_pedal_is_active(void)
TEST(PedalsSystemTesting, test_pedal_is_active)
{
PedalsParams params_for_test = {1, 1, 10, 10, 1, 1, 9, 9};
PedalsSystem pedals_system(params_for_test, params_for_test);
Expand All @@ -34,7 +35,7 @@ void test_pedal_is_active(void)
for (const auto &test_case : test_cases)
{
auto out = pedals_system.mech_brake_active(test_case.pedalsinput);
TEST_ASSERT_EQUAL(test_case.expect_active, out);
EXPECT_EQ(test_case.expect_active, out);
}
}

Expand Down

0 comments on commit 343e806

Please sign in to comment.