testability: bench test commands should have automated coverage using simulator #5562
This commit is contained in:
parent
daf4edb04e
commit
e5f7c9885c
|
@ -508,9 +508,13 @@ void OutputPin::setValue(const char *msg, int logicValue, bool isForce) {
|
|||
// ScopePerf perf(PE::OutputPinSetValue);
|
||||
#endif // ENABLE_PERF_TRACE
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
unitTestTurnedOnCounter++;
|
||||
#if EFI_UNIT_TEST || EFI_SIMULATOR
|
||||
if (currentLogicValue != logicValue) {
|
||||
pinToggleCounter++;
|
||||
}
|
||||
#endif // EFI_UNIT_TEST || EFI_SIMULATOR
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
if (verboseMode) {
|
||||
efiPrintf("pin goes %d", logicValue);
|
||||
}
|
||||
|
@ -587,7 +591,7 @@ void OutputPin::initPin(const char *msg, brain_pin_e brainPin) {
|
|||
|
||||
void OutputPin::initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError) {
|
||||
#if EFI_UNIT_TEST
|
||||
unitTestTurnedOnCounter = 0;
|
||||
pinToggleCounter = 0;
|
||||
#endif
|
||||
|
||||
if (!isBrainPinValid(brainPin)) {
|
||||
|
|
|
@ -65,8 +65,8 @@ public:
|
|||
uint8_t pin = 0;
|
||||
#endif /* EFI_GPIO_HARDWARE */
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
int unitTestTurnedOnCounter = 0;
|
||||
#if EFI_UNIT_TEST || EFI_SIMULATOR
|
||||
int pinToggleCounter = 0;
|
||||
#endif
|
||||
|
||||
brain_pin_e brainPin = Gpio::Unassigned;
|
||||
|
|
|
@ -34,7 +34,7 @@ TEST(HPFP, IntegratedSchedule) {
|
|||
/**
|
||||
* overall this is a pretty lame test but helps to know that the whole on/off/on dance does in fact happen for HPFP
|
||||
*/
|
||||
ASSERT_EQ(31, enginePins.hpfpValve.unitTestTurnedOnCounter);
|
||||
ASSERT_EQ(8, enginePins.hpfpValve.pinToggleCounter);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue