Clean-up analog channels in "unit" tests #1456
This commit is contained in:
parent
695c8ddb03
commit
f32e7c19f4
|
@ -97,7 +97,9 @@ TEST(misc, testFuelMap) {
|
||||||
float injectorLag = getInjectorLag(getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
float injectorLag = getInjectorLag(getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
ASSERT_EQ( 0, injectorLag) << "injectorLag";
|
ASSERT_EQ( 0, injectorLag) << "injectorLag";
|
||||||
|
|
||||||
testMafValue = 5;
|
|
||||||
|
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||||
|
engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 5 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
// 1005 * 2 for IAT correction
|
// 1005 * 2 for IAT correction
|
||||||
printf("*************************************************** getRunningFuel 2\r\n");
|
printf("*************************************************** getRunningFuel 2\r\n");
|
||||||
|
@ -109,7 +111,7 @@ TEST(misc, testFuelMap) {
|
||||||
EXPECT_EQ( 42, getRunningFuel(1 PASS_ENGINE_PARAMETER_SUFFIX)) << "v1";
|
EXPECT_EQ( 42, getRunningFuel(1 PASS_ENGINE_PARAMETER_SUFFIX)) << "v1";
|
||||||
EXPECT_EQ( 84, getRunningFuel(2 PASS_ENGINE_PARAMETER_SUFFIX)) << "v1";
|
EXPECT_EQ( 84, getRunningFuel(2 PASS_ENGINE_PARAMETER_SUFFIX)) << "v1";
|
||||||
|
|
||||||
testMafValue = 0;
|
engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
engineConfiguration->cranking.baseFuel = 4;
|
engineConfiguration->cranking.baseFuel = 4;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "trigger_universal.h"
|
#include "trigger_universal.h"
|
||||||
#include "sensor.h"
|
#include "sensor.h"
|
||||||
|
|
||||||
extern float testMafValue;
|
|
||||||
extern WarningCodeState unitTestWarningCodeState;
|
extern WarningCodeState unitTestWarningCodeState;
|
||||||
extern bool printTriggerDebug;
|
extern bool printTriggerDebug;
|
||||||
extern float actualSynchGap;
|
extern float actualSynchGap;
|
||||||
|
@ -944,7 +943,9 @@ void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) {
|
||||||
eth.executeActions();
|
eth.executeActions();
|
||||||
|
|
||||||
engine->mockMapValue = 0;
|
engine->mockMapValue = 0;
|
||||||
testMafValue = 0;
|
|
||||||
|
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||||
|
engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
ASSERT_EQ( 1, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#testFuelSchedulerBug299smallAndMedium";
|
ASSERT_EQ( 1, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#testFuelSchedulerBug299smallAndMedium";
|
||||||
ASSERT_EQ(CUSTOM_OBD_SKIPPED_FUEL, unitTestWarningCodeState.recentWarnings.get(0));
|
ASSERT_EQ(CUSTOM_OBD_SKIPPED_FUEL, unitTestWarningCodeState.recentWarnings.get(0));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue