test organization (#3882)

* organize actuators

* this test can be useful

* don't name things misc

* fewer tests called misc

* fewer tests called "big" (?)

* unnecessary
This commit is contained in:
Matthew Kennedy 2022-02-02 13:36:35 -08:00 committed by GitHub
parent 2595decb58
commit 28f39fe71c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 39 additions and 45 deletions

View File

@ -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);
}

View File

@ -2,7 +2,7 @@
#include "fan_control.h"
TEST(FanControl, fan1) {
TEST(Actuators, Fan) {
EngineTestHelper eth(TEST_ENGINE);
engineConfiguration->fanOnTemperature = 90;

View File

@ -11,7 +11,7 @@
extern int timeNowUs;
TEST(fsio, fuelPump) {
TEST(Actuators, FuelPump) {
EngineTestHelper eth(TEST_ENGINE);
FuelPumpController dut;

View File

@ -2,7 +2,7 @@
#include "main_relay.h"
TEST(MainRelay, mainRelayLogic) {
TEST(Actuators, MainRelay) {
EngineTestHelper eth(TEST_ENGINE);
MainRelayController dut;

View File

@ -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);

View File

@ -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));
}

View File

@ -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);

View File

@ -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();

View File

@ -92,7 +92,7 @@ static void testSwitchToNanPeriod() {
assertNextEvent("exec3@NAN", LOW_VALUE, &executor, pin);
}
TEST(misc, testPwmGenerator) {
TEST(PWM, testPwmGenerator) {
test100dutyCycle();
testSwitchToNanPeriod();

View File

@ -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);

View File

@ -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 \

View File

@ -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");
{

View File

@ -159,7 +159,7 @@ static void testNoiselessDecoderProcedure(EngineTestHelper &eth, int errorTolera
}
TEST(big, testNoiselessDecoder) {
TEST(trigger, noiselessDecoder) {
printf("====================================================================================== testNoiselessDecoder\r\n");
EngineTestHelper eth(TEST_ENGINE);