diff --git a/unit_tests/tests/test_aux_valves.cpp b/unit_tests/tests/actuators/test_aux_valves.cpp similarity index 96% rename from unit_tests/tests/test_aux_valves.cpp rename to unit_tests/tests/actuators/test_aux_valves.cpp index a4466af59c..5c29e6c862 100644 --- a/unit_tests/tests/test_aux_valves.cpp +++ b/unit_tests/tests/actuators/test_aux_valves.cpp @@ -9,7 +9,7 @@ #include "aux_valves.h" -TEST(misc, testAuxValves) { +TEST(Actuators, AuxValves) { Sensor::setMockValue(SensorType::DriverThrottleIntent, 0); EngineTestHelper eth(NISSAN_PRIMERA); @@ -25,5 +25,4 @@ TEST(misc, testAuxValves) { eth.assertTriggerEvent("a0", 0, &engine->auxValves[0][0].open, (void*)&auxPlainPinTurnOn, 7, 86); eth.assertTriggerEvent("a1", 1, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 3, 86); eth.assertTriggerEvent("a2", 2, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 5, 86); - } diff --git a/unit_tests/tests/test_boost.cpp b/unit_tests/tests/actuators/test_boost.cpp similarity index 100% rename from unit_tests/tests/test_boost.cpp rename to unit_tests/tests/actuators/test_boost.cpp diff --git a/unit_tests/tests/test_dc_motor.cpp b/unit_tests/tests/actuators/test_dc_motor.cpp similarity index 100% rename from unit_tests/tests/test_dc_motor.cpp rename to unit_tests/tests/actuators/test_dc_motor.cpp diff --git a/unit_tests/tests/test_etb.cpp b/unit_tests/tests/actuators/test_etb.cpp similarity index 100% rename from unit_tests/tests/test_etb.cpp rename to unit_tests/tests/actuators/test_etb.cpp diff --git a/unit_tests/tests/test_fan_control.cpp b/unit_tests/tests/actuators/test_fan_control.cpp similarity index 98% rename from unit_tests/tests/test_fan_control.cpp rename to unit_tests/tests/actuators/test_fan_control.cpp index 5165bdfe9b..cc3017f53d 100644 --- a/unit_tests/tests/test_fan_control.cpp +++ b/unit_tests/tests/actuators/test_fan_control.cpp @@ -2,7 +2,7 @@ #include "fan_control.h" -TEST(FanControl, fan1) { +TEST(Actuators, Fan) { EngineTestHelper eth(TEST_ENGINE); engineConfiguration->fanOnTemperature = 90; diff --git a/unit_tests/tests/test_logic_expression.cpp b/unit_tests/tests/actuators/test_fuel_pump.cpp similarity index 97% rename from unit_tests/tests/test_logic_expression.cpp rename to unit_tests/tests/actuators/test_fuel_pump.cpp index 64681dcd00..10940c30e3 100644 --- a/unit_tests/tests/test_logic_expression.cpp +++ b/unit_tests/tests/actuators/test_fuel_pump.cpp @@ -11,7 +11,7 @@ extern int timeNowUs; -TEST(fsio, fuelPump) { +TEST(Actuators, FuelPump) { EngineTestHelper eth(TEST_ENGINE); FuelPumpController dut; diff --git a/unit_tests/tests/test_gppwm.cpp b/unit_tests/tests/actuators/test_gppwm.cpp similarity index 100% rename from unit_tests/tests/test_gppwm.cpp rename to unit_tests/tests/actuators/test_gppwm.cpp diff --git a/unit_tests/tests/test_main_relay.cpp b/unit_tests/tests/actuators/test_main_relay.cpp similarity index 92% rename from unit_tests/tests/test_main_relay.cpp rename to unit_tests/tests/actuators/test_main_relay.cpp index 698f2671cb..eb8f60eb8e 100644 --- a/unit_tests/tests/test_main_relay.cpp +++ b/unit_tests/tests/actuators/test_main_relay.cpp @@ -2,7 +2,7 @@ #include "main_relay.h" -TEST(MainRelay, mainRelayLogic) { +TEST(Actuators, MainRelay) { EngineTestHelper eth(TEST_ENGINE); MainRelayController dut; diff --git a/unit_tests/tests/test_stepper.cpp b/unit_tests/tests/actuators/test_stepper.cpp similarity index 100% rename from unit_tests/tests/test_stepper.cpp rename to unit_tests/tests/actuators/test_stepper.cpp diff --git a/unit_tests/tests/test_tacho.cpp b/unit_tests/tests/actuators/test_tacho.cpp similarity index 97% rename from unit_tests/tests/test_tacho.cpp rename to unit_tests/tests/actuators/test_tacho.cpp index a69499c1ca..05af7199de 100644 --- a/unit_tests/tests/test_tacho.cpp +++ b/unit_tests/tests/actuators/test_tacho.cpp @@ -3,7 +3,7 @@ extern float getTachFreq(void); extern float getTachDuty(void); -TEST(tachometer, testPulsePerRev) { +TEST(Actuators, Tachometer) { // This engine has a tach pin set - we need that EngineTestHelper eth(FRANKENSO_MAZDA_MIATA_2003); diff --git a/unit_tests/tests/test_vvt.cpp b/unit_tests/tests/actuators/test_vvt.cpp similarity index 100% rename from unit_tests/tests/test_vvt.cpp rename to unit_tests/tests/actuators/test_vvt.cpp diff --git a/unit_tests/tests/test_cpp_memory_layout.cpp b/unit_tests/tests/test_cpp_memory_layout.cpp index 8d758c000e..bdb47d0729 100644 --- a/unit_tests/tests/test_cpp_memory_layout.cpp +++ b/unit_tests/tests/test_cpp_memory_layout.cpp @@ -37,7 +37,7 @@ public: }; -TEST(misc, cppPlainStructMemoryLayout) { +TEST(CppMemoryLayout, PlainStruct) { TestPlainChild c; // validate field initializers just for fun ASSERT_EQ(540, c.field0); @@ -55,15 +55,12 @@ TEST(misc, cppPlainStructMemoryLayout) { static int valueWePointAt; -TEST(misc, cppVirtualStructMemoryLayout) { +TEST(CppMemoryLayout, VirtualStruct) { TestChildWithVirtual c; - int pointerSize = sizeof(int*); - - // '4' in case of 32 bit target // '8' in case of 64 bit target - int MAGIC_VTABLE_SIZE = pointerSize; + int MAGIC_VTABLE_SIZE = sizeof(void*); // validate field initializers just for fun ASSERT_EQ(540, c.field0); @@ -85,7 +82,7 @@ TEST(misc, cppVirtualStructMemoryLayout) { } -TEST(misc, cppPlainExtraFieldsStructMemoryLayout) { +TEST(CppMemoryLayout, PlainExtraFieldsStruct) { TestPlainChildExtraFields c; ASSERT_EQ(sizeof(c), sizeof(TestParent) + 8); @@ -96,3 +93,12 @@ TEST(misc, cppPlainExtraFieldsStructMemoryLayout) { ASSERT_EQ(540, destimationInt); ASSERT_EQ(0, (uintptr_t)&c.field0 - (uintptr_t)&c); } + +TEST(CppMemoryLayout, structSize) { + ASSERT_EQ(1, sizeof(adc_channel_e)) << "small enum size"; + ASSERT_EQ(1, sizeof(pin_input_mode_e)) << "small enum size"; + ASSERT_EQ(1, sizeof(pin_output_mode_e)) << "small enum size"; + ASSERT_EQ(1, sizeof(brain_pin_e)) << "small enum size"; + ASSERT_EQ(16, sizeof(air_pressure_sensor_config_s)); + ASSERT_EQ(TOTAL_CONFIG_SIZE, sizeof(persistent_config_s)); +} diff --git a/unit_tests/tests/test_engine_math.cpp b/unit_tests/tests/test_engine_math.cpp index d422866639..c967d0a24e 100644 --- a/unit_tests/tests/test_engine_math.cpp +++ b/unit_tests/tests/test_engine_math.cpp @@ -11,17 +11,6 @@ #include "maf.h" #include "advance_map.h" -TEST(misc, structSize) { - ASSERT_EQ(1, sizeof(adc_channel_e)) << "small enum size"; - ASSERT_EQ(1, sizeof(pin_input_mode_e)) << "small enum size"; - ASSERT_EQ(1, sizeof(pin_output_mode_e)) << "small enum size"; - ASSERT_EQ(1, sizeof(brain_pin_e)) << "small enum size"; - ASSERT_EQ(16, sizeof(air_pressure_sensor_config_s)); -/* no longer the case at least for Proteus - ASSERT_EQ(20000, sizeof(persistent_config_s)); -*/ -} - TEST(misc, testIgnitionPlanning) { printf("*************************************************** testIgnitionPlanning\r\n"); EngineTestHelper eth(FORD_ESCORT_GT); diff --git a/unit_tests/tests/test_pid_auto.cpp b/unit_tests/tests/test_pid_auto.cpp index c6976b3771..d071fae44a 100644 --- a/unit_tests/tests/test_pid_auto.cpp +++ b/unit_tests/tests/test_pid_auto.cpp @@ -211,7 +211,7 @@ TEST(pidAutoTune, delayLine) { ASSERT_TRUE(result) << "should be true#5"; } -TEST(misc, testPidAuto) { +TEST(pidAutoTune, testPidAuto) { printf("*************************************************** testPidAuto\r\n"); testPidAutoZigZagStable(); diff --git a/unit_tests/tests/test_pwm_generator.cpp b/unit_tests/tests/test_pwm_generator.cpp index 028ce6b706..af7557eef8 100644 --- a/unit_tests/tests/test_pwm_generator.cpp +++ b/unit_tests/tests/test_pwm_generator.cpp @@ -92,7 +92,7 @@ static void testSwitchToNanPeriod() { assertNextEvent("exec3@NAN", LOW_VALUE, &executor, pin); } -TEST(misc, testPwmGenerator) { +TEST(PWM, testPwmGenerator) { test100dutyCycle(); testSwitchToNanPeriod(); diff --git a/unit_tests/tests/test_signal_executor.cpp b/unit_tests/tests/test_signal_executor.cpp index 828596bc46..65abe1ede7 100644 --- a/unit_tests/tests/test_signal_executor.cpp +++ b/unit_tests/tests/test_signal_executor.cpp @@ -33,7 +33,7 @@ static void complexCallback(TestPwm *testPwm) { { complexCallback, testPwm }); } -TEST(misc, testSignalExecutor2) { +TEST(EventQueue, testSignalExecutor2) { EventQueue eq; TestPwm p1(&eq); TestPwm p2(&eq); diff --git a/unit_tests/tests/tests.mk b/unit_tests/tests/tests.mk index 1b3ba4770e..af2886316f 100644 --- a/unit_tests/tests/tests.mk +++ b/unit_tests/tests/tests.mk @@ -40,33 +40,25 @@ TESTS_SRC_CPP = \ tests/test_start_stop.cpp \ tests/test_hardware_reinit.cpp \ tests/test_ion.cpp \ - tests/test_aux_valves.cpp \ tests/test_hip9011.cpp \ tests/test_engine_math.cpp \ tests/test_fasterEngineSpinningUp.cpp \ tests/test_dwell_corner_case_issue_796.cpp \ tests/test_idle_controller.cpp \ tests/test_issue_898.cpp \ - tests/test_etb.cpp \ - tests/test_dc_motor.cpp \ - tests/test_fan_control.cpp \ - tests/test_main_relay.cpp \ tests/test_scattered_outputs.cpp \ - tests/test_vvt.cpp \ tests/test_launch.cpp \ tests/test_fuel_map.cpp \ tests/ignition_injection/test_fuel_wall_wetting.cpp \ tests/test_one_cylinder_logic.cpp \ tests/test_tunerstudio.cpp \ tests/test_pwm_generator.cpp \ - tests/test_logic_expression.cpp \ tests/test_log_buffer.cpp \ tests/test_signal_executor.cpp \ tests/test_cpp_memory_layout.cpp \ tests/test_pid_auto.cpp \ tests/test_pid.cpp \ tests/test_accel_enrichment.cpp \ - tests/test_tacho.cpp \ tests/test_gpiochip.cpp \ tests/test_deadband.cpp \ tests/test_knock.cpp \ @@ -84,8 +76,6 @@ TESTS_SRC_CPP = \ tests/sensor/table_func.cpp \ tests/util/test_closed_loop_controller.cpp \ tests/test_stft.cpp \ - tests/test_boost.cpp \ - tests/test_gppwm.cpp \ tests/test_hpfp.cpp \ tests/test_hpfp_integrated.cpp \ tests/test_fuel_math.cpp \ @@ -95,7 +85,17 @@ TESTS_SRC_CPP = \ tests/test_limp.cpp \ tests/trigger/test_all_triggers.cpp \ tests/test_can_serial.cpp \ - tests/test_stepper.cpp \ tests/sensor/test_frequency_sensor.cpp \ tests/sensor/test_turbocharger_speed_converter.cpp \ - tests/sensor/test_vehicle_speed_converter.cpp + tests/sensor/test_vehicle_speed_converter.cpp \ + tests/actuators/test_aux_valves.cpp \ + tests/actuators/test_boost.cpp \ + tests/actuators/test_dc_motor.cpp \ + tests/actuators/test_etb.cpp \ + tests/actuators/test_fan_control.cpp \ + tests/actuators/test_fuel_pump.cpp \ + tests/actuators/test_gppwm.cpp \ + tests/actuators/test_main_relay.cpp \ + tests/actuators/test_stepper.cpp \ + tests/actuators/test_tacho.cpp \ + tests/actuators/test_vvt.cpp \ diff --git a/unit_tests/tests/trigger/test_trigger_decoder.cpp b/unit_tests/tests/trigger/test_trigger_decoder.cpp index 7dbf7d6f2f..d40b617bb8 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -46,7 +46,7 @@ static int getTriggerZeroEventIndex(engine_type_e engineType) { engineConfiguration->trigger); } -TEST(misc, testSkipped2_0) { +TEST(trigger, testSkipped2_0) { EngineTestHelper eth(TEST_ENGINE); // for this test we need a trigger with isSynchronizationNeeded=true engineConfiguration->trigger.customTotalToothCount = 2; @@ -109,7 +109,7 @@ static void assertTriggerPosition(event_trigger_position_s *position, int eventI assertEqualsM("angleOffset", angleOffset, position->angleOffsetFromTriggerEvent); } -TEST(misc, testSomethingWeird) { +TEST(trigger, testSomethingWeird) { EngineTestHelper eth(FORD_INLINE_6_1995); TriggerState state_; @@ -145,7 +145,7 @@ TEST(misc, testSomethingWeird) { ASSERT_EQ(0, sta->getCurrentIndex()); // new revolution } -TEST(misc, test1995FordInline6TriggerDecoder) { +TEST(trigger, test1995FordInline6TriggerDecoder) { ASSERT_EQ( 0, getTriggerZeroEventIndex(FORD_INLINE_6_1995)) << "triggerIndex "; EngineTestHelper eth(FORD_INLINE_6_1995); @@ -450,11 +450,11 @@ TEST(misc, testRpmCalculator) { engine->executor.clear(); } -TEST(misc, testAnotherTriggerDecoder) { +TEST(trigger, testAnotherTriggerDecoder) { testTriggerDecoder2("Miata 2003", FRANKENSO_MAZDA_MIATA_2003, 3, 0.38888889, 0.0); } -TEST(misc, testTriggerDecoder) { +TEST(trigger, testTriggerDecoder) { printf("====================================================================================== testTriggerDecoder\r\n"); { diff --git a/unit_tests/tests/trigger/test_trigger_noiseless.cpp b/unit_tests/tests/trigger/test_trigger_noiseless.cpp index a74fd674f0..0d8dd85257 100644 --- a/unit_tests/tests/trigger/test_trigger_noiseless.cpp +++ b/unit_tests/tests/trigger/test_trigger_noiseless.cpp @@ -159,7 +159,7 @@ static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorTolera } -TEST(big, testNoiselessDecoder) { +TEST(trigger, noiselessDecoder) { printf("====================================================================================== testNoiselessDecoder\r\n"); EngineTestHelper eth(TEST_ENGINE);