fix tests

This commit is contained in:
Matthew Kennedy 2020-07-28 14:27:34 -07:00
parent a3c0942e1a
commit eea3f2cf36
4 changed files with 17 additions and 3 deletions

View File

@ -319,7 +319,6 @@ void setupSimpleTestEngineWithMaf(EngineTestHelper *eth, injection_mode_e inject
eth->clearQueue();
ASSERT_EQ(LM_MOCK, engineConfiguration->fuelAlgorithm);
engineConfiguration->isIgnitionEnabled = false; // let's focus on injection
engineConfiguration->specs.cylindersCount = 4;
// a bit of flexibility - the mode may be changed by some tests

View File

@ -11,8 +11,12 @@
#include "sensor.h"
#include "fsio_impl.h"
using ::testing::_;
TEST(fuelCut, coasting) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
EXPECT_CALL(eth.mockAirmass, getAirmass(_))
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));
// configure coastingFuelCut
engineConfiguration->coastingFuelCutEnabled = true;

View File

@ -21,6 +21,7 @@ using ::testing::FloatNear;
TEST(misc, testFuelMap) {
printf("Setting up FORD_ASPIRE_1996\r\n");
WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996);
engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF;
printf("Filling fuel map\r\n");
for (int k = 0; k < FUEL_LOAD_COUNT; k++) {

View File

@ -23,6 +23,8 @@
#include "trigger_universal.h"
#include "sensor.h"
using ::testing::_;
extern WarningCodeState unitTestWarningCodeState;
extern bool printTriggerDebug;
extern float actualSynchGap;
@ -295,9 +297,10 @@ static void assertREqualsM(const char *msg, void *expected, void *actual) {
extern bool_t debugSignalExecutor;
TEST(misc, testRpmCalculator) {
printf("*************************************************** testRpmCalculator\r\n");
WITH_ENGINE_TEST_HELPER(FORD_INLINE_6_1995);
EXPECT_CALL(eth.mockAirmass, getAirmass(_))
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));
IgnitionEventList *ilist = &engine->ignitionEvents;
ASSERT_EQ( 0, ilist->isReady) << "size #1";
@ -588,6 +591,8 @@ static void assertInjectionEventBatch(const char *msg, InjectionEvent *ev, int i
}
static void setTestBug299(EngineTestHelper *eth) {
// TODO: switch to mock airmass
eth->persistentConfig.engineConfiguration.fuelAlgorithm = LM_PLAIN_MAF;
setupSimpleTestEngineWithMafAndTT_ONE_trigger(eth);
Engine *engine = &eth->engine;
EXPAND_Engine
@ -977,6 +982,8 @@ TEST(big, testFuelSchedulerBug299smallAndMedium) {
TEST(big, testTwoWireBatch) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth);
EXPECT_CALL(eth.mockAirmass, getAirmass(_))
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));
engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;
@ -1002,6 +1009,9 @@ TEST(big, testTwoWireBatch) {
TEST(big, testSequential) {
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
EXPECT_CALL(eth.mockAirmass, getAirmass(_))
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth);
engineConfiguration->injectionMode = IM_SEQUENTIAL;