diff --git a/unit_tests/engine_test_helper.h b/unit_tests/engine_test_helper.h index 6364d667d9..3dd46139fc 100644 --- a/unit_tests/engine_test_helper.h +++ b/unit_tests/engine_test_helper.h @@ -13,6 +13,7 @@ #include "main_trigger_callback.h" #include "unit_test_framework.h" + /** * Mock engine with trigger signal simulation infrastructure */ diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 7e440c0099..1bccaf3974 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -12,12 +12,10 @@ #include "test_accel_enrichment.h" #include "test_interpolation_3d.h" #include "test_find_index.h" -#include "test_sensors.h" #include "test_speed_density.h" #include "test_fuel_map.h" #include "fuel_math.h" -#include "test_fuelCut.h" #include "test_logic_expression.h" #include "test_pid_auto.h" #include "engine_configuration.h" @@ -68,7 +66,7 @@ GTEST_API_ int main(int argc, char **argv) { * PID */ testPidAuto(); - testPidController(); + /** * Larger-scale engine control */ @@ -82,10 +80,9 @@ GTEST_API_ int main(int argc, char **argv) { testFasterEngineSpinningUp(); testGpsParser(); testFuelMap(); - testFuelCut(); testEngineMath(); testIgnitionPlanning(); - testSensors(); + /** * Data structures and general methods */ diff --git a/unit_tests/tests/test_fuelCut.cpp b/unit_tests/tests/test_fuelCut.cpp index 7c03c64285..51b794669a 100644 --- a/unit_tests/tests/test_fuelCut.cpp +++ b/unit_tests/tests/test_fuelCut.cpp @@ -5,17 +5,14 @@ */ #include "engine_math.h" -#include "test_fuelCut.h" #include "test_trigger_decoder.h" #include "event_queue.h" #include "unit_test_framework.h" #include "tps.h" -extern EventQueue schedulingQueue; extern int timeNowUs; -extern EnginePins enginePins; -void testCoastingFuelCut() { +TEST(fuelCut, coasting) { // this is just a reference unit test implementation printf("*************************************************** testCoastingFuelCut\r\n"); @@ -102,7 +99,3 @@ void testCoastingFuelCut() { // Fuel cut-off is active again! assertEqualsM("inj dur#7 cut", 0.0f, ENGINE(injectionDuration)); } - -void testFuelCut() { - testCoastingFuelCut(); -} diff --git a/unit_tests/tests/test_fuelCut.h b/unit_tests/tests/test_fuelCut.h deleted file mode 100644 index ae924b53cb..0000000000 --- a/unit_tests/tests/test_fuelCut.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * test_fuelCut.h - * - * Created on: Mar 22, 2018 - */ - -#ifndef TEST_FUELCUT_H_ -#define TEST_FUELCUT_H_ - -#include "global.h" - -void testFuelCut(); - -#endif /* TEST_FUELCUT_H_ */ diff --git a/unit_tests/tests/test_hip9011.cpp b/unit_tests/tests/test_hip9011.cpp index 4a18a07a96..65a1703064 100644 --- a/unit_tests/tests/test_hip9011.cpp +++ b/unit_tests/tests/test_hip9011.cpp @@ -7,8 +7,6 @@ #include "unit_test_framework.h" #include "hip9011_lookup.h" #include "HIP9011_logic.h" -#include "gtest/gtest.h" -#include "gmock/gmock.h" using ::testing::_; TEST(hip9011, lookup) { diff --git a/unit_tests/tests/test_idle_controller.cpp b/unit_tests/tests/test_idle_controller.cpp index 8923c2ad9f..ac46eaa7fb 100644 --- a/unit_tests/tests/test_idle_controller.cpp +++ b/unit_tests/tests/test_idle_controller.cpp @@ -8,7 +8,7 @@ #include "engine_test_helper.h" #include "pid.h" -void testPidController(void) { +TEST(idle, pid) { print("******************************************* testPidController\r\n"); pid_s pidS; pidS.pFactor = 50; diff --git a/unit_tests/tests/test_idle_controller.h b/unit_tests/tests/test_idle_controller.h index 0f87bd9474..0e0ff65ae9 100644 --- a/unit_tests/tests/test_idle_controller.h +++ b/unit_tests/tests/test_idle_controller.h @@ -2,6 +2,5 @@ #define TEST_IDLE_CONTROLLER_H void idleDebug(char *msg, int value); -void testPidController(void); #endif diff --git a/unit_tests/tests/test_pid_auto.cpp b/unit_tests/tests/test_pid_auto.cpp index ecd2c8ca69..9ed68a7d21 100644 --- a/unit_tests/tests/test_pid_auto.cpp +++ b/unit_tests/tests/test_pid_auto.cpp @@ -10,7 +10,6 @@ #include "pid_auto_tune.h" #include "unit_test_framework.h" #include "cyclic_buffer.h" -#include "gtest/gtest.h" efitimems_t mockTimeMs = 0; diff --git a/unit_tests/tests/test_sensors.cpp b/unit_tests/tests/test_sensors.cpp index fe21b0b282..b763fbc3d3 100644 --- a/unit_tests/tests/test_sensors.cpp +++ b/unit_tests/tests/test_sensors.cpp @@ -12,7 +12,7 @@ static ThermistorConf tc; -static void testMapDecoding(void) { +TEST(sensors, mapDecoding) { EngineTestHelper eth(FORD_INLINE_6_1995); EXPAND_EngineTestHelper; @@ -27,7 +27,7 @@ static void testMapDecoding(void) { assertEquals(58.4, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX)); } -void testTps(void) { +TEST(sensors, tps) { print("************************************************** testTps\r\n"); EngineTestHelper eth(DODGE_RAM); @@ -57,11 +57,7 @@ void testTpsRateOfChange(void) { // assertEquals(25, getTpsRateOfChange()); } -void testSensors(void) { - print("************************************************** testSensors\r\n"); - testMapDecoding(); - testTps(); - testTpsRateOfChange(); +TEST(sensors, tm) { ThermistorMath tm; { diff --git a/unit_tests/tests/test_sensors.h b/unit_tests/tests/test_sensors.h deleted file mode 100644 index fce06df95a..0000000000 --- a/unit_tests/tests/test_sensors.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file test_sensors.h - * - * @date Dec 7, 2013 - * @author Andrey Belomutskiy, (c) 2012-2017 - */ - -#ifndef TEST_SENSORS_H_ -#define TEST_SENSORS_H_ - -void testSensors(void); - -#endif /* TEST_SENSORS_H_ */ diff --git a/unit_tests/unit_test_framework.h b/unit_tests/unit_test_framework.h index 8bd4e7d016..25dfea8092 100644 --- a/unit_tests/unit_test_framework.h +++ b/unit_tests/unit_test_framework.h @@ -9,6 +9,8 @@ #define UNIT_TEST_FRAMEWORK_H_ #include "engine.h" +#include "gtest/gtest.h" +#include "gmock/gmock.h" void assertEqualsM2(const char *msg, float expected, float actual, float EPS); void assertEqualsM(const char *msg, float expected, float actual);