2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file test_accel_enrichment.cpp
|
|
|
|
*
|
|
|
|
* Created on: apr 29, 2014
|
|
|
|
* Author: Dmitry Sidin
|
2018-07-28 09:42:37 -07:00
|
|
|
* Author: Andrey Belomutskiy, (c) 2012-2018
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2018-09-16 19:39:46 -07:00
|
|
|
#include "global.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "accel_enrichment.h"
|
|
|
|
#include "engine_configuration.h"
|
2016-03-09 20:02:39 -08:00
|
|
|
#include "engine_test_helper.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-13 19:34:36 -08:00
|
|
|
TEST(big, testAccelEnrichment) {
|
2018-12-25 14:26:36 -08:00
|
|
|
printf("====================================================================================== testAccelEnrichment\r\n");
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-19 17:42:29 -08:00
|
|
|
WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->rpmCalculator.setRpmValue(600 PASS_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2016-03-09 20:02:39 -08:00
|
|
|
|
|
|
|
engine->tpsAccelEnrichment.setLength(4);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta";
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(10 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 40, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#1";
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(30 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#2";
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#3";
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 80, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#4";
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#5";
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta";
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|