From 73aa22573eec6b91509a81b8804b0621ff344086 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 14 Jan 2019 15:31:56 -0500 Subject: [PATCH] migrating to googletest --- unit_tests/main.cpp | 53 ------------------- .../test_basic_math/test_find_index.cpp | 6 +-- unit_tests/test_basic_math/test_find_index.h | 2 - .../test_basic_math/test_interpolation_3d.cpp | 2 +- .../test_basic_math/test_interpolation_3d.h | 1 - unit_tests/tests/test_accel_enrichment.h | 12 ----- unit_tests/tests/test_engine_math.cpp | 9 ++-- unit_tests/tests/test_engine_math.h | 16 ------ .../tests/test_fasterEngineSpinningUp.cpp | 16 +++--- unit_tests/tests/test_fuel_map.cpp | 9 ++-- unit_tests/tests/test_fuel_map.h | 16 ------ unit_tests/tests/test_logic_expression.cpp | 3 +- unit_tests/tests/test_logic_expression.h | 13 ----- unit_tests/tests/test_pid_auto.cpp | 3 +- unit_tests/tests/test_pid_auto.h | 13 ----- unit_tests/tests/test_pwm_generator.cpp | 2 +- unit_tests/tests/test_sensors.cpp | 2 +- unit_tests/tests/test_signal_executor.cpp | 2 +- unit_tests/tests/test_signal_executor.h | 2 - unit_tests/tests/test_speed_density.h | 11 ---- unit_tests/tests/test_trigger_decoder.cpp | 19 +++---- unit_tests/tests/test_trigger_decoder.h | 4 -- unit_tests/tests/test_util.cpp | 13 +++-- unit_tests/tests/test_util.h | 19 ------- 24 files changed, 37 insertions(+), 211 deletions(-) delete mode 100644 unit_tests/tests/test_accel_enrichment.h delete mode 100644 unit_tests/tests/test_engine_math.h delete mode 100644 unit_tests/tests/test_fuel_map.h delete mode 100644 unit_tests/tests/test_logic_expression.h delete mode 100644 unit_tests/tests/test_pid_auto.h delete mode 100644 unit_tests/tests/test_speed_density.h delete mode 100644 unit_tests/tests/test_util.h diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 2c84353c3f..299e3307a0 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -9,25 +9,17 @@ #include #include "global.h" -#include "test_accel_enrichment.h" #include "test_interpolation_3d.h" #include "test_find_index.h" -#include "test_speed_density.h" -#include "test_fuel_map.h" -#include "fuel_math.h" -#include "test_logic_expression.h" -#include "test_pid_auto.h" #include "engine_configuration.h" #include "test_idle_controller.h" #include "afm2mapConverter.h" #include "test_signal_executor.h" #include "trigger_central.h" -#include "test_util.h" #include "map_resize.h" #include "engine_math.h" -#include "test_engine_math.h" #include "test_trigger_decoder.h" #include "gtest/gtest.h" @@ -58,51 +50,6 @@ extern bool printTriggerDebug; GTEST_API_ int main(int argc, char **argv) { // printTriggerDebug = true; - testMisc(); - /** - * PID - */ - testPidAuto(); - - testLogicExpressions(); // fsio - testGpsParser(); - testFuelMap(); - testEngineMath(); - testIgnitionPlanning(); - - /** - * Data structures and general methods - */ - testFindIndex(); - testInterpolate3d(); - testInterpolate2d(); - testSetTableValue(); - - testFLStack(); - - testSignalExecutor(); - testPwmGenerator(); - - - /** - * Business logic tests - */ - testMalfunctionCentral(); - - testConsoleLogic(); - - testAngleResolver(); - - testPinHelper(); - - testMenuTree(); - testMafLookup(); - testIgnitionMapGenerator(); - testMafFuelMath(); - - testTriggerDecoder(); - - // resizeMap(); printf("Success 20190103\r\n"); printAllTriggers(); diff --git a/unit_tests/test_basic_math/test_find_index.cpp b/unit_tests/test_basic_math/test_find_index.cpp index 238faabe8b..16e122a821 100644 --- a/unit_tests/test_basic_math/test_find_index.cpp +++ b/unit_tests/test_basic_math/test_find_index.cpp @@ -15,7 +15,7 @@ static void testIndex(const int expected, const float array[], int size, float v assertEquals(expected, findIndex2(array, size, value)); } -void testFindIndex(void) { +TEST(misc, testFindIndex) { printf("*************************************************** testFindIndex\r\n"); /* { @@ -66,7 +66,7 @@ void testFindIndex(void) { } } -void testInterpolate2d(void) { +TEST(misc, testInterpolate2d) { printf("*************************************************** testInterpolate2d\r\n"); float bins4[] = { 1, 2, 3, 4 }; @@ -92,7 +92,7 @@ void testInterpolate2d(void) { assertEquals(215, result); } -void testSetTableValue(void) { +TEST(misc, testSetTableValue) { printf("*************************************************** testSetTableValue\r\n"); persistent_config_s config; diff --git a/unit_tests/test_basic_math/test_find_index.h b/unit_tests/test_basic_math/test_find_index.h index d98d9457a3..f21837241f 100644 --- a/unit_tests/test_basic_math/test_find_index.h +++ b/unit_tests/test_basic_math/test_find_index.h @@ -9,7 +9,5 @@ #define TEST_FIND_INDEX_H_ void testFindIndex(void); -void testInterpolate2d(void); -void testSetTableValue(void); #endif /* TEST_FIND_INDEX_H_ */ diff --git a/unit_tests/test_basic_math/test_interpolation_3d.cpp b/unit_tests/test_basic_math/test_interpolation_3d.cpp index 7704c01897..fd8a01e40b 100644 --- a/unit_tests/test_basic_math/test_interpolation_3d.cpp +++ b/unit_tests/test_basic_math/test_interpolation_3d.cpp @@ -79,7 +79,7 @@ static void newTestToComfirmInterpolation() { assertEqualsM("320 @ -12.3 ", 3.2, getValue(/*rpm*/320, -12.3)); } -void testInterpolate3d(void) { +TEST(misc, testInterpolate3d) { printf("*************************************************** testInterpolate3d\r\n"); printf("*** no interpolation here 1\r\n"); diff --git a/unit_tests/test_basic_math/test_interpolation_3d.h b/unit_tests/test_basic_math/test_interpolation_3d.h index 200b301bb7..0528c36db8 100644 --- a/unit_tests/test_basic_math/test_interpolation_3d.h +++ b/unit_tests/test_basic_math/test_interpolation_3d.h @@ -11,6 +11,5 @@ #ifndef TEST_INTERPOLATION_3D_H_ #define TEST_INTERPOLATION_3D_H_ -void testInterpolate3d(void); #endif /* TEST_INTERPOLATION_3D_H_ */ diff --git a/unit_tests/tests/test_accel_enrichment.h b/unit_tests/tests/test_accel_enrichment.h deleted file mode 100644 index 777b927b83..0000000000 --- a/unit_tests/tests/test_accel_enrichment.h +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @file test_accel_enrichment.h - * - * Created on: apr 29, 2014 - * Author: Dmitry Sidin - * Author: Andrey Belomutskiy, (c) 2012-2015 - */ - -#ifndef TEST_ACCEL_ENRICHMENT_H_ -#define TEST_ACCEL_ENRICHMENT_H_ - -#endif /* TEST_ACCEL_ENRICHMENT_H_ */ diff --git a/unit_tests/tests/test_engine_math.cpp b/unit_tests/tests/test_engine_math.cpp index 1e8b0d791a..809bca28bc 100644 --- a/unit_tests/tests/test_engine_math.cpp +++ b/unit_tests/tests/test_engine_math.cpp @@ -5,7 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2019 */ -#include "test_engine_math.h" #include "global.h" #include "engine_math.h" #include "engine_configuration.h" @@ -15,7 +14,7 @@ #include "maf.h" #include "advance_map.h" -void testIgnitionPlanning(void) { +TEST(misc, testIgnitionPlanning) { printf("*************************************************** testIgnitionPlanning\r\n"); EngineTestHelper eth(FORD_ESCORT_GT); EXPAND_EngineTestHelper; @@ -26,7 +25,7 @@ void testIgnitionPlanning(void) { assertEquals(IM_BATCH, engineConfiguration->injectionMode); } -void testEngineMath(void) { +TEST(misc, testEngineMath) { printf("*************************************************** testEngineMath\r\n"); EngineTestHelper eth(FORD_ESCORT_GT); @@ -59,7 +58,7 @@ void testEngineMath(void) { assertEquals(65.5625f/*kg/h*/, engine->engineState.airFlow); } -void testIgnitionMapGenerator(void) { +TEST(misc, testIgnitionMapGenerator) { printf("*************************************************** testIgnitionMapGenerator\r\n"); assertEquals(35, getTopAdvanceForBore(CS_OPEN, 98, 8, 101.6)); @@ -86,7 +85,7 @@ void testIgnitionMapGenerator(void) { assertEqualsM2("20@800", 14.2, getInitialAdvance(800, 20, 36), 0.2); } -void testMafLookup(void) { +TEST(misc, testMafLookup) { printf("*************************************************** testMafLookup\r\n"); EngineTestHelper eth(FORD_ESCORT_GT); diff --git a/unit_tests/tests/test_engine_math.h b/unit_tests/tests/test_engine_math.h deleted file mode 100644 index d7b4e4fd90..0000000000 --- a/unit_tests/tests/test_engine_math.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * @file test_engine_math.h - * - * Created on: Nov 14, 2013 - * Author: Andrey Belomutskiy, (c) 2012-2015 - */ - -#ifndef TEST_ENGINE_MATH_H_ -#define TEST_ENGINE_MATH_H_ - -void testEngineMath(void); -void testIgnitionPlanning(void); -void testMafLookup(void); -void testIgnitionMapGenerator(void); - -#endif /* TEST_ENGINE_MATH_H_ */ diff --git a/unit_tests/tests/test_fasterEngineSpinningUp.cpp b/unit_tests/tests/test_fasterEngineSpinningUp.cpp index 1731724cbf..185cb265d8 100644 --- a/unit_tests/tests/test_fasterEngineSpinningUp.cpp +++ b/unit_tests/tests/test_fasterEngineSpinningUp.cpp @@ -32,7 +32,7 @@ TEST(sensors, testFasterEngineSpinningUp) { // check RPM assertEqualsM("RPM=0", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); // the queue should be empty, no trigger events yet - assertEqualsM("plain#1", 0, engine->executor.size()); + ASSERT_EQ(0, engine->executor.size()) << "plain#1"; // check all events starting from now int timeStartUs = eth.getTimeNowUs(); @@ -41,15 +41,15 @@ TEST(sensors, testFasterEngineSpinningUp) { eth.fireRise(200); // check if the mode is changed - assertEquals(SPINNING_UP, engine->rpmCalculator.getState()); + ASSERT_EQ(SPINNING_UP, engine->rpmCalculator.getState()); // due to isFasterEngineSpinUp=true, we should have already detected RPM! assertEqualsM("spinning-RPM#1", 300, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); // two simultaneous injections - assertEqualsM("plain#1", 4, engine->executor.size()); + ASSERT_EQ(4, engine->executor.size()) << "plain#2"; // test if they are simultaneous - assertEquals(IM_SIMULTANEOUS, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_SIMULTANEOUS, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); // test if ignition mode is temporary changed to wasted spark, if set to ind.coils - assertEquals(IM_WASTED_SPARK, getIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_WASTED_SPARK, getIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); // check real events eth.assertEvent5(&engine->executor, "inj start#1", 0, (void*)startSimultaniousInjection, timeStartUs, MS2US(200) + 97975); eth.assertEvent5(&engine->executor, "inj end#1", 1, (void*)endSimultaniousInjection, timeStartUs, MS2US(200) + 100000); @@ -63,13 +63,13 @@ TEST(sensors, testFasterEngineSpinningUp) { eth.fireRise(200); // check if the mode is changed when fully synched - assertEquals(CRANKING, engine->rpmCalculator.getState()); + ASSERT_EQ(CRANKING, engine->rpmCalculator.getState()); // check RPM assertEqualsM("RPM#2", 300, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); // test if they are simultaneous in cranking mode too - assertEquals(IM_SIMULTANEOUS, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_SIMULTANEOUS, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); // test if ignition mode is restored to ind.coils - assertEquals(IM_INDIVIDUAL_COILS, getIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_INDIVIDUAL_COILS, getIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); // two simultaneous injections assertEqualsM("plain#2", 4, engine->executor.size()); // check real events diff --git a/unit_tests/tests/test_fuel_map.cpp b/unit_tests/tests/test_fuel_map.cpp index 3cf386455d..146b7f1db8 100644 --- a/unit_tests/tests/test_fuel_map.cpp +++ b/unit_tests/tests/test_fuel_map.cpp @@ -5,7 +5,6 @@ * @author Andrey Belomutskiy, (c) 2012-2019 */ -#include "test_fuel_map.h" #include "global.h" #include "engine_configuration.h" #include "fuel_math.h" @@ -19,7 +18,7 @@ extern float testMafValue; -void testMafFuelMath(void) { +TEST(misc, testMafFuelMath) { printf("====================================================================================== testMafFuelMath\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); EXPAND_EngineTestHelper; @@ -33,7 +32,7 @@ void testMafFuelMath(void) { assertEqualsM("fuelMs", 26.7099, fuelMs); } -void testFuelMap(void) { +TEST(misc, testFuelMap) { printf("====================================================================================== testFuelMap\r\n"); printf("Setting up FORD_ASPIRE_1996\r\n"); @@ -161,7 +160,7 @@ static void confgiureFordAspireTriggerShape(TriggerShape * s) { assertEqualsM("expecting 1", 1, s->wave.findInsertionAngle(63.747 / 720.0, s->getSize())); } -void testAngleResolver(void) { +TEST(misc, testAngleResolver) { printf("*************************************************** testAngleResolver\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); @@ -217,7 +216,7 @@ void testAngleResolver(void) { confgiureFordAspireTriggerShape(&t); } -void testPinHelper(void) { +TEST(misc, testPinHelper) { printf("*************************************************** testPinHelper\r\n"); assertEquals(0, getElectricalValue(0, OM_DEFAULT)); assertEquals(1, getElectricalValue(1, OM_DEFAULT)); diff --git a/unit_tests/tests/test_fuel_map.h b/unit_tests/tests/test_fuel_map.h deleted file mode 100644 index 6de5fe6866..0000000000 --- a/unit_tests/tests/test_fuel_map.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * test_fuel_map.h - * - * Created on: Nov 6, 2013 - * Author: pc - */ - -#ifndef TEST_FUEL_MAP_H_ -#define TEST_FUEL_MAP_H_ - -void testFuelMap(void); -void testMafFuelMath(void); -void testAngleResolver(void); -void testPinHelper(void); - -#endif /* TEST_FUEL_MAP_H_ */ diff --git a/unit_tests/tests/test_logic_expression.cpp b/unit_tests/tests/test_logic_expression.cpp index 545be4810d..b564ea7bb1 100644 --- a/unit_tests/tests/test_logic_expression.cpp +++ b/unit_tests/tests/test_logic_expression.cpp @@ -8,7 +8,6 @@ */ #include "global.h" -#include "test_logic_expression.h" #include "fsio_impl.h" #include "cli_registry.h" #include "engine_test_helper.h" @@ -106,7 +105,7 @@ static void testExpression(const char *line, float expected) { testExpression2(0, line, expected); } -void testLogicExpressions(void) { +TEST(misc, testLogicExpressions) { printf("*************************************************** testLogicExpressions\r\n"); testParsing(); diff --git a/unit_tests/tests/test_logic_expression.h b/unit_tests/tests/test_logic_expression.h deleted file mode 100644 index 5bea826570..0000000000 --- a/unit_tests/tests/test_logic_expression.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file test_logic_expression.h - * - * @date Oct 3, 2014 - * @author Andrey Belomutskiy, (c) 2012-2014 - */ - -#ifndef TEST_LOGIC_EXPRESSION_H_ -#define TEST_LOGIC_EXPRESSION_H_ - -void testLogicExpressions(void); - -#endif /* TEST_LOGIC_EXPRESSION_H_ */ diff --git a/unit_tests/tests/test_pid_auto.cpp b/unit_tests/tests/test_pid_auto.cpp index 9ed68a7d21..b7b2c56738 100644 --- a/unit_tests/tests/test_pid_auto.cpp +++ b/unit_tests/tests/test_pid_auto.cpp @@ -6,7 +6,6 @@ */ #include "global.h" -#include "test_pid_auto.h" #include "pid_auto_tune.h" #include "unit_test_framework.h" #include "cyclic_buffer.h" @@ -214,7 +213,7 @@ TEST(pidAutoTune, delayLine) { assertTrueM("should be true#5", result); } -void testPidAuto() { +TEST(misc, testPidAuto) { printf("*************************************************** testPidAuto\r\n"); testPidAutoZigZagStable(); diff --git a/unit_tests/tests/test_pid_auto.h b/unit_tests/tests/test_pid_auto.h deleted file mode 100644 index 42ee6cce4f..0000000000 --- a/unit_tests/tests/test_pid_auto.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @file test_pid_auto.h - * - * Created on: Sep 14, 2017 - * @author Andrey Belomutskiy, (c) 2012-2017 - */ - -#ifndef TEST_PID_AUTO_H_ -#define TEST_PID_AUTO_H_ - -void testPidAuto(); - -#endif /* TEST_PID_AUTO_H_ */ diff --git a/unit_tests/tests/test_pwm_generator.cpp b/unit_tests/tests/test_pwm_generator.cpp index 8c775bf1a1..ed91f81c66 100644 --- a/unit_tests/tests/test_pwm_generator.cpp +++ b/unit_tests/tests/test_pwm_generator.cpp @@ -101,7 +101,7 @@ static void testSwitchToNanPeriod() { assertNextEvent("exec3@NAN", LOW_VALUE, &executor); } -void testPwmGenerator() { +TEST(misc, testPwmGenerator) { test100dutyCycle(); testSwitchToNanPeriod(); diff --git a/unit_tests/tests/test_sensors.cpp b/unit_tests/tests/test_sensors.cpp index b763fbc3d3..8444dea8c5 100644 --- a/unit_tests/tests/test_sensors.cpp +++ b/unit_tests/tests/test_sensors.cpp @@ -44,7 +44,7 @@ TEST(sensors, tps) { assertEqualsM("test#2", 50.6667, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER_SUFFIX)); } -void testTpsRateOfChange(void) { +TEST(sensors, testTpsRateOfChange) { print("************************************************** testTpsRateOfChange\r\n"); // saveTpsState(0, 0); // saveTpsState(CH_FREQUENCY, 50); diff --git a/unit_tests/tests/test_signal_executor.cpp b/unit_tests/tests/test_signal_executor.cpp index 868ffdd786..0cf86ff53c 100644 --- a/unit_tests/tests/test_signal_executor.cpp +++ b/unit_tests/tests/test_signal_executor.cpp @@ -91,7 +91,7 @@ static void testSignalExecutor3(void) { eq.executeAll(100); } -void testSignalExecutor(void) { +TEST(misc, testSignalExecutor) { testSignalExecutor3(); print("*************************************** testSignalExecutor\r\n"); diff --git a/unit_tests/tests/test_signal_executor.h b/unit_tests/tests/test_signal_executor.h index 26a460856e..a1386b7f77 100644 --- a/unit_tests/tests/test_signal_executor.h +++ b/unit_tests/tests/test_signal_executor.h @@ -9,7 +9,5 @@ #define TEST_SIGNAL_EXECUTOR_H_ int getRevolutionCounter(); -void testSignalExecutor(void); -void testPwmGenerator(); #endif /* TEST_SIGNAL_EXECUTOR_H_ */ diff --git a/unit_tests/tests/test_speed_density.h b/unit_tests/tests/test_speed_density.h deleted file mode 100644 index 2716d95e1a..0000000000 --- a/unit_tests/tests/test_speed_density.h +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @file test_speed_density.h - * - * @date Jun 26, 2014 - * @author Andrey Belomutskiy, (c) 2012-2014 - */ - -#ifndef TEST_SPEED_DENSITY_H_ -#define TEST_SPEED_DENSITY_H_ - -#endif /* TEST_SPEED_DENSITY_H_ */ diff --git a/unit_tests/tests/test_trigger_decoder.cpp b/unit_tests/tests/test_trigger_decoder.cpp index 451ca827fe..a88f7ec926 100644 --- a/unit_tests/tests/test_trigger_decoder.cpp +++ b/unit_tests/tests/test_trigger_decoder.cpp @@ -112,7 +112,7 @@ static void assertTriggerPosition(event_trigger_position_s *position, int eventI assertEqualsM("angleOffset", angleOffset, position->angleOffset); } -void testSomethingWeird(void) { +TEST(misc, testSomethingWeird) { printf("*************************************************** testSomethingWeird\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); @@ -149,8 +149,7 @@ void testSomethingWeird(void) { assertEquals(0, sta->getCurrentIndex()); // new revolution } -void test1995FordInline6TriggerDecoder(void) { - testSomethingWeird(); +TEST(misc, test1995FordInline6TriggerDecoder) { printf("*************************************************** test1995FordInline6TriggerDecoder\r\n"); @@ -194,7 +193,7 @@ void test1995FordInline6TriggerDecoder(void) { assertEqualsM("running dwell", 0.5, getSparkDwell(2000 PASS_ENGINE_PARAMETER_SUFFIX)); } -void testFordAspire(void) { +TEST(misc, testFordAspire) { printf("*************************************************** testFordAspire\r\n"); assertEqualsM("getTriggerZeroEventIndex", 4, getTriggerZeroEventIndex(FORD_ASPIRE_1996)); @@ -242,7 +241,7 @@ static void testTriggerDecoder3(const char *msg, engine_type_e type, int synchPo printTriggerDebug = false; } -void testStartupFuelPumping(void) { +TEST(misc, testStartupFuelPumping) { printf("*************************************************** testStartupFuelPumping\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); EXPAND_EngineTestHelper; @@ -294,7 +293,7 @@ static void assertREqualsM(const char *msg, void *expected, void *actual) { extern bool_t debugSignalExecutor; extern EnginePins enginePins; -void testRpmCalculator(void) { +TEST(misc, testRpmCalculator) { printf("*************************************************** testRpmCalculator\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); @@ -445,7 +444,7 @@ void testRpmCalculator(void) { engine->executor.clear(); } -void testTriggerDecoder(void) { +TEST(misc, testTriggerDecoder) { printf("====================================================================================== testTriggerDecoder\r\n"); persistent_config_s c; @@ -470,7 +469,6 @@ void testTriggerDecoder(void) { testDodgeNeonDecoder(); testTriggerDecoder2("Dodge Neon 1995", DODGE_NEON_1995, 8, 0.4931, 0.2070); - testFordAspire(); testTriggerDecoder2("ford aspire", FORD_ASPIRE_1996, 4, 0.0000, 0.5); testTriggerDecoder2("dodge ram", DODGE_RAM, 16, 0.5000, 0.06); @@ -478,7 +476,6 @@ void testTriggerDecoder(void) { //testTriggerDecoder2("bmw", BMW_E34, 0, 0.9750, 0.5167); testTriggerDecoder2("bmw", BMW_E34, 0, 0.4667, 0.0); - test1995FordInline6TriggerDecoder(); testTriggerDecoder2("Miata NB", MAZDA_MIATA_NB1, 12, 0.0833, 0.0444); testTriggerDecoder2("Miata 2003", MAZDA_MIATA_2003, 3, 0.0444, 0.0); @@ -574,10 +571,6 @@ void testTriggerDecoder(void) { testTriggerDecoder3("stratus NGC6", DODGE_STRATUS, 0, 0.8833, 0.0, CHRYSLER_NGC6_GAP); testTriggerDecoder2("vw ABA", VW_ABA, 114, 0.5000, 0.0); - - - testStartupFuelPumping(); - testRpmCalculator(); } extern fuel_Map3D_t fuelMap; diff --git a/unit_tests/tests/test_trigger_decoder.h b/unit_tests/tests/test_trigger_decoder.h index 61f9ff60f7..bfb2a779b6 100644 --- a/unit_tests/tests/test_trigger_decoder.h +++ b/unit_tests/tests/test_trigger_decoder.h @@ -10,10 +10,6 @@ #include "engine_test_helper.h" -void testTriggerDecoder(void); -void testRpmCalculator(void); -void testStartupFuelPumping(void); -void test1995FordInline6TriggerDecoder(void); void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPointIndex, float channel1duty, float channel2duty); void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injMode = IM_BATCH); diff --git a/unit_tests/tests/test_util.cpp b/unit_tests/tests/test_util.cpp index 2e9ad554bb..4364f7545e 100644 --- a/unit_tests/tests/test_util.cpp +++ b/unit_tests/tests/test_util.cpp @@ -7,7 +7,6 @@ #include -#include "test_util.h" #include "cyclic_buffer.h" #include "global.h" #include "histogram.h" @@ -184,7 +183,7 @@ static void testMalfunctionCentralRemoveFirstElement() { assertEquals(secondElement, localCopy.error_codes[0]); } -void testMalfunctionCentral(void) { +TEST(misc, testMalfunctionCentral) { testMalfunctionCentralRemoveNonExistent(); testMalfunctionCentralSameElementAgain(); testMalfunctionCentralRemoveFirstElement(); @@ -255,7 +254,7 @@ static loc_t GPSdata; static char nmeaMessage[1000]; -void testGpsParser(void) { +TEST(misc, testGpsParser) { print("******************************************* testGpsParser\r\n"); strcpy(nmeaMessage, ""); @@ -309,7 +308,7 @@ void testGpsParser(void) { // this buffer is needed because on Unix you would not be able to change static char constants static char buffer[300]; -void testConsoleLogic(void) { +TEST(misc, testConsoleLogic) { print("******************************************* testConsoleLogic\r\n"); resetConsoleActions(); @@ -377,7 +376,7 @@ void testConsoleLogic(void) { //addConsoleActionSSS("GPS", testGpsParser); } -void testFLStack(void) { +TEST(misc, testFLStack) { print("******************************************* testFLStack\r\n"); FLStack stack; @@ -409,7 +408,7 @@ void testFLStack(void) { static char buff[32]; -void testMisc(void) { +TEST(misc, testMisc) { print("******************************************* testMisc\r\n"); strcpy(buff, " ab "); // we need a mutable array here @@ -433,7 +432,7 @@ void testMisc(void) { // assertEquals(SPARKOUT_12_OUTPUT, getPinByName("spa12")); } -void testMenuTree(void) { +TEST(misc, testMenuTree) { print("******************************************* testMenuTree\r\n"); MenuItem ROOT(NULL, NULL); diff --git a/unit_tests/tests/test_util.h b/unit_tests/tests/test_util.h deleted file mode 100644 index f934e39b5e..0000000000 --- a/unit_tests/tests/test_util.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file test_cyclic_buffer.h - * - * @date Dec 8, 2013 - * @author Andrey Belomutskiy, (c) 2012-2017 - */ - -#ifndef TEST_CYCLIC_BUFFER_H_ -#define TEST_CYCLIC_BUFFER_H_ - -void testMisc(void); -void testMalfunctionCentral(void); -void testConsoleLogic(void); -void testGpsParser(void); -void testFLStack(void); -void testMisc(void); -void testMenuTree(void); - -#endif /* TEST_CYCLIC_BUFFER_H_ */