rusefi/unit_tests/tests/test_fuel_math.cpp

32 lines
914 B
C++
Raw Normal View History

2020-05-05 05:01:40 -07:00
#include "engine_test_helper.h"
#include "fuel_math.h"
#include "gtest/gtest.h"
TEST(FuelMath, getStandardAirCharge) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
// Miata 1839cc 4cyl
CONFIG(specs.displacement) = 1.839f;
CONFIG(specs.cylindersCount) = 4;
2020-07-22 13:11:07 -07:00
EXPECT_FLOAT_EQ(0.5535934f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE));
2020-05-05 05:01:40 -07:00
// LS 5.3 liter v8
CONFIG(specs.displacement) = 5.327f;
CONFIG(specs.cylindersCount) = 8;
2020-07-22 13:11:07 -07:00
EXPECT_FLOAT_EQ(0.80179232f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE));
2020-05-05 05:01:40 -07:00
// Chainsaw - single cylinder 32cc
CONFIG(specs.displacement) = 0.032f;
CONFIG(specs.cylindersCount) = 1;
2020-07-22 13:11:07 -07:00
EXPECT_FLOAT_EQ(0.038531788f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE));
2020-05-05 05:01:40 -07:00
// Leopard 1 47.666 liter v12
CONFIG(specs.displacement) = 47.666f;
CONFIG(specs.cylindersCount) = 12;
2020-07-22 13:11:07 -07:00
EXPECT_FLOAT_EQ(4.782959f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE));
2020-05-05 05:01:40 -07:00
}