improve test
This commit is contained in:
parent
7e88011de5
commit
cad0d47443
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "fuel_math.h"
|
||||
#include "maf_airmass.h"
|
||||
#include "trigger_structure.h"
|
||||
#include "allsensors.h"
|
||||
#include "engine_math.h"
|
||||
|
@ -14,18 +15,25 @@
|
|||
#include "efi_gpio.h"
|
||||
#include "advance_map.h"
|
||||
#include "sensor.h"
|
||||
#include "mocks.h"
|
||||
|
||||
using ::testing::FloatNear;
|
||||
|
||||
TEST(misc, testMafFuelMath) {
|
||||
WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996);
|
||||
extern fuel_Map3D_t veMap;
|
||||
veMap.setAll(75);
|
||||
|
||||
engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
|
||||
engineConfiguration->injector.flow = 200;
|
||||
|
||||
setAfrMap(config->afrTable, 13);
|
||||
|
||||
auto airmass = getRealMafAirmass(200, 6000 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
MockVp3d veTable;
|
||||
// Ensure that the correct cell is read from the VE table
|
||||
EXPECT_CALL(veTable, getValue(6000, FloatNear(70.9814f, EPS4D)))
|
||||
.WillOnce(Return(75.0f));
|
||||
|
||||
MafAirmass dut(veTable);
|
||||
INJECT_ENGINE_REFERENCE(&dut);
|
||||
|
||||
auto airmass = dut.getAirmassImpl(200, 6000);
|
||||
|
||||
// Check results
|
||||
EXPECT_NEAR(0.277777f * 0.75f, airmass.CylinderAirmass, EPS4D);
|
||||
|
|
Loading…
Reference in New Issue