something is not right here :(

This commit is contained in:
rusefi 2019-01-21 22:45:37 -05:00
parent 6b67ce6e20
commit 6c58be4213
2 changed files with 24 additions and 3 deletions

View File

@ -13,6 +13,11 @@ TEST(cranking, testFasterEngineSpinningUp) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
// turn on FasterEngineSpinUp mode
engineConfiguration->bc.isFasterEngineSpinUpEnabled = true;
// todo: it's depressing that this unit test does not survive a bit of idle time in the beginning
// todo: uncomment
//eth.moveTimeForwardMs(1000 /*ms*/);
eth.firePrimaryTriggerRise();
// set ignition mode
@ -96,13 +101,23 @@ TEST(cranking, testFasterEngineSpinningUp) {
eth.assertEvent5(&engine->executor, "inj end#3", 1, (void*)seTurnPinLow, timeStartUs, MS2US(60) + 27974 + 3000);
}
TEST(cranking, testFasterEngineSpinningUp60_2) {
static void doTestFasterEngineSpinningUp60_2(int startUpDelayMs, int expectedRpm) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
// turn on FasterEngineSpinUp mode
engineConfiguration->bc.isFasterEngineSpinUpEnabled = true;
setupSimpleTestEngineWithMaf(&eth, IM_SEQUENTIAL, TT_TOOTHED_WHEEL_60_2);
eth.moveTimeForwardMs(startUpDelayMs);
eth.fireTriggerEvents2(30 /* count */, 1 /*ms*/);
eth.fireTriggerEvents2(1, 4);
EXPECT_EQ(expectedRpm, GET_RPM()) << "test RPM with " + std::to_string(startUpDelayMs) + " startUpDelayMs";
}
TEST(cranking, testFasterEngineSpinningUp60_2) {
// I do not get it. Startup delay is affecting instance RPM?
// todo: is this feature implementation issue or test framework issue?
doTestFasterEngineSpinningUp60_2(0, 220);
doTestFasterEngineSpinningUp60_2(100, 89);
doTestFasterEngineSpinningUp60_2(1000, 0);
}

View File

@ -690,10 +690,11 @@ static void assertInjectors(const char *msg, int value0, int value1) {
assertEqualsM4(msg, "inj#1", value1, enginePins.injectors[1].currentLogicValue);
}
TEST(big, testFuelSchedulerBug299smallAndMedium) {
void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) {
printf("*************************************************** testFuelSchedulerBug299 small to medium\r\n");
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
eth.moveTimeForwardMs(startUpDelayMs); // nice to know that same test works the same with different anount of idle time on start
setTestBug299(&eth);
FuelSchedule * t;
@ -941,6 +942,11 @@ static void setInjectionMode(int value DECLARE_ENGINE_PARAMETER_SUFFIX) {
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
}
TEST(big, testFuelSchedulerBug299smallAndMedium) {
doTestFuelSchedulerBug299smallAndMedium(0);
doTestFuelSchedulerBug299smallAndMedium(1000);
}
TEST(big, testDifferentInjectionModes) {
printf("*************************************************** testDifferentInjectionModes\r\n");