Trigger: warning code on normal engine start up #669
better TDC unit test approach?
This commit is contained in:
parent
d4de3a6ebc
commit
2013a496ef
|
@ -3,6 +3,7 @@ TESTS_SRC_CPP = \
|
|||
tests/trigger/test_trigger_decoder.cpp \
|
||||
tests/trigger/test_trigger_noiseless.cpp \
|
||||
tests/trigger/test_trigger_multi_sync.cpp \
|
||||
tests/trigger/test_miata_na_tdc.cpp \
|
||||
tests/trigger/test_cam_vvt_input.cpp \
|
||||
tests/trigger/test_2jz_vvt.cpp \
|
||||
tests/trigger/test_real_cranking_miata_NA.cpp \
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#include "engine_test_helper.h"
|
||||
#include "globalaccess.h"
|
||||
#include "trigger_simulator.h"
|
||||
#include "trigger_emulator_algo.h"
|
||||
|
||||
TEST(miata, miata_na_tdc) {
|
||||
WITH_ENGINE_TEST_HELPER(MIATA_NA6_MAP);
|
||||
|
||||
#define TEST_REVOLUTIONS 6
|
||||
|
||||
TriggerWaveform & shape = engine->triggerCentral.triggerShape;
|
||||
|
||||
TriggerEmulatorHelper emulatorHelper;
|
||||
|
||||
/**
|
||||
* let's feed two more cycles to validate shape definition
|
||||
*/
|
||||
for (uint32_t i = 0; i <= TEST_REVOLUTIONS * shape.getSize(); i++) {
|
||||
|
||||
int time = getSimulatedEventTime(shape, i);
|
||||
eth.setTimeAndInvokeEventsUs(time);
|
||||
|
||||
emulatorHelper.handleEmulatorCallback(shape.getSize(),
|
||||
shape.wave,
|
||||
i % shape.getSize() PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
|
||||
ASSERT_EQ(167, GET_RPM()) << "miata_na_tdc RPM";
|
||||
ASSERT_EQ(3894000, engine->tdcScheduler[0].momentX); // let's assert TDC position and sync point
|
||||
ASSERT_EQ(4614000, engine->tdcScheduler[1].momentX); // let's assert TDC position and sync point
|
||||
}
|
Loading…
Reference in New Issue