fome-fw/unit_tests/tests/test_issue_898.cpp

28 lines
1007 B
C++
Raw Normal View History

/*
2019-10-07 18:54:03 -07:00
* @file test_issue_898.cpp
*
2019-10-07 18:54:03 -07:00
* @date Aug 8, 2019
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "engine_test_helper.h"
2019-11-17 06:03:20 -08:00
extern WarningCodeState unitTestWarningCodeState;
2019-08-08 19:12:51 -07:00
static void boardConfigurationForIssue898(engine_configuration_s *engineConfiguration) {
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
}
TEST(issues, issue898) {
EngineTestHelper eth(ISSUE_898, &boardConfigurationForIssue898);
EXPAND_EngineTestHelper;
ASSERT_EQ(TRUE, engine->triggerCentral.triggerShape.shapeDefinitionError) << "MRE_MIATA_NA6 shapeDefinitionError";
ASSERT_EQ( 2, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#testFuelSchedulerBug299smallAndMedium";
ASSERT_EQ(CUSTOM_ERR_BOTH_FRONTS_REQUIRED, unitTestWarningCodeState.recentWarnings.get(0));
ASSERT_EQ(CUSTOM_ERR_TRIGGER_SYNC, unitTestWarningCodeState.recentWarnings.get(1));
}