rusefi-1/unit_tests/tests/test_speed_density.cpp

35 lines
1009 B
C++

/**
* @file test_speed_density.cpp
*
* @date Jun 26, 2014
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "engine_test_helper.h"
#include "speed_density.h"
#include "fuel_math.h"
TEST(big, testSpeedDensity) {
printf("*************************************************** testSpeedDensity\r\n");
WITH_ENGINE_TEST_HELPER(FORD_INLINE_6_1995);
engineConfiguration->trigger.customTotalToothCount = 8;
eth.applyTriggerWaveform();
eth.fireTriggerEvents(36);
ASSERT_EQ( 1500, GET_RPM()) << "RPM";
// 427 cubic inches, that's a LOT of engine
engineConfiguration->specs.displacement = 6.99728;
engineConfiguration->specs.cylindersCount = 8;
engineConfiguration->injector.flow = gramm_second_to_cc_minute(5.303);
float airMass = SpeedDensityBase::getAirmassImpl(0.92, 98, 293.16 PASS_ENGINE_PARAMETER_SUFFIX);
ASSERT_FLOAT_EQ(0.9371106624, airMass);
// 0.01414 sec or 14.14 ms
EXPECT_NEAR(0.014137, getInjectionDurationForAirmass(airMass, 12.5 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D);
}