migrating to SensorType::Rpm API
This commit is contained in:
parent
e945bc4bc9
commit
e37ab73f1d
|
@ -35,7 +35,7 @@ TEST(fuel, testWallWettingEnrichmentScheduling) {
|
|||
|
||||
|
||||
eth.fireTriggerEvents2(/* count */ 4, 25 /* ms */);
|
||||
ASSERT_EQ( 1200, GET_RPM()) << "RPM";
|
||||
ASSERT_EQ( 1200, Sensor::getOrZero(SensorType::Rpm)) << "RPM";
|
||||
|
||||
int expectedInvocationCounter = 1;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ TEST(ignition, trailingSpark) {
|
|||
eth.fireTriggerEventsWithDuration(20);
|
||||
// still no RPM since need to cycles measure cycle duration
|
||||
eth.fireTriggerEventsWithDuration(20);
|
||||
ASSERT_EQ( 3000, GET_RPM()) << "RPM#0";
|
||||
ASSERT_EQ( 3000, Sensor::getOrZero(SensorType::Rpm)) << "RPM#0";
|
||||
eth.clearQueue();
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@ TEST(issues, issueOneCylinderSpecialCase968) {
|
|||
ASSERT_EQ( 0, engine->executor.size()) << "start";
|
||||
|
||||
eth.fireTriggerEvents2(/* count */ 2, 50 /* ms */);
|
||||
ASSERT_EQ( 0, GET_RPM()) << "RPM";
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "RPM";
|
||||
ASSERT_EQ( 0, engine->executor.size()) << "first revolution(s)";
|
||||
|
||||
eth.fireTriggerEvents2(/* count */ 1, 50 /* ms */);
|
||||
|
|
|
@ -14,15 +14,15 @@ TEST(engine, testPlainCrankingWithoutAdvancedFeatures) {
|
|||
engineConfiguration->cranking.baseFuel = 12;
|
||||
|
||||
setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð);
|
||||
ASSERT_EQ( 0, GET_RPM()) << "RPM=0";
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "RPM=0";
|
||||
|
||||
eth.fireTriggerEventsWithDuration(/* durationMs */ 200);
|
||||
// still no RPM since need to cycles measure cycle duration
|
||||
ASSERT_EQ( 0, GET_RPM()) << "start-RPM#1";
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "start-RPM#1";
|
||||
|
||||
|
||||
eth.fireRise(/* delayMs */ 200);
|
||||
ASSERT_EQ( 300, GET_RPM()) << "RPM#2";
|
||||
ASSERT_EQ( 300, Sensor::getOrZero(SensorType::Rpm)) << "RPM#2";
|
||||
// two simultaneous injections
|
||||
ASSERT_EQ( 4, engine->executor.size()) << "plain#2";
|
||||
|
||||
|
@ -35,7 +35,7 @@ TEST(engine, testPlainCrankingWithoutAdvancedFeatures) {
|
|||
TEST(priming, startScheduling) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
ASSERT_EQ( 0, GET_RPM()) << "RPM=0";
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "RPM=0";
|
||||
|
||||
// Turn on the ignition switch!
|
||||
engine->module<PrimeController>()->onIgnitionStateChanged(true);
|
||||
|
|
|
@ -50,7 +50,7 @@ TEST(fuel, testTpsAccelEnrichmentScheduling) {
|
|||
Sensor::setMockValue(SensorType::Tps1, 7);
|
||||
|
||||
eth.fireTriggerEvents2(/* count */ 4, 25 /* ms */);
|
||||
ASSERT_EQ( 1200, GET_RPM()) << "RPM";
|
||||
ASSERT_EQ( 1200, Sensor::getOrZero(SensorType::Rpm)) << "RPM";
|
||||
int expectedInvocationCounter = 1;
|
||||
ASSERT_EQ(expectedInvocationCounter, engine->tpsAccelEnrichment.onUpdateInvocationCounter);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ TEST(tachometer, testPulsePerRev) {
|
|||
eth.fireTriggerEvents(48);
|
||||
|
||||
// ensure engine speed
|
||||
ASSERT_EQ(1500, GET_RPM()) << "RPM";
|
||||
ASSERT_EQ(1500, Sensor::getOrZero(SensorType::Rpm)) << "RPM";
|
||||
ASSERT_EQ(engine->triggerCentral.triggerState.getShaftSynchronized(), true);
|
||||
|
||||
// Poke the fast callback to update the tach
|
||||
|
|
|
@ -16,14 +16,14 @@ TEST(sensors, test2jz) {
|
|||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
eth.setTriggerType(TT_ONE);
|
||||
|
||||
ASSERT_EQ( 0, GET_RPM()) << "test2jz RPM";
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "test2jz RPM";
|
||||
for (int i = 0; i < 2;i++) {
|
||||
eth.fireRise(25);
|
||||
ASSERT_EQ( 0, GET_RPM()) << "test2jz RPM at " << i;
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "test2jz RPM at " << i;
|
||||
}
|
||||
eth.fireRise(25);
|
||||
// first time we have RPM
|
||||
ASSERT_EQ(2400, GET_RPM()) << "test2jz RPM";
|
||||
ASSERT_EQ(2400, Sensor::getOrZero(SensorType::Rpm)) << "test2jz RPM";
|
||||
|
||||
|
||||
eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles
|
||||
|
|
|
@ -15,7 +15,7 @@ TEST(trigger, map_cam_by_magic_point) {
|
|||
engineConfiguration->mapCamDetectionAnglePosition = 90;
|
||||
|
||||
eth.smartFireTriggerEvents2(/*count*/10, /*delayMs*/200);
|
||||
ASSERT_EQ(150, GET_RPM()) << "RPM";
|
||||
ASSERT_EQ(150, Sensor::getOrZero(SensorType::Rpm)) << "RPM";
|
||||
|
||||
ASSERT_EQ(1, engine->outputChannels.TEMPLOG_map_peak);
|
||||
ASSERT_EQ(0, engine->outputChannels.vvtSyncCounter);
|
||||
|
|
|
@ -24,14 +24,14 @@ TEST(trigger, testQuadCam) {
|
|||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->vvtCamSensorUseRise = true;
|
||||
|
||||
ASSERT_EQ(0, GET_RPM());
|
||||
ASSERT_EQ(0, Sensor::getOrZero(SensorType::Rpm));
|
||||
for (int i = 0; i < 2;i++) {
|
||||
eth.fireRise(25);
|
||||
ASSERT_EQ( 0, GET_RPM());
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm));
|
||||
}
|
||||
eth.fireRise(25);
|
||||
// first time we have RPM
|
||||
ASSERT_EQ(2400, GET_RPM());
|
||||
ASSERT_EQ(2400, Sensor::getOrZero(SensorType::Rpm));
|
||||
|
||||
// need to be out of VVT sync to see VVT sync in action
|
||||
eth.fireRise(25);
|
||||
|
|
|
@ -15,7 +15,7 @@ static void runRpmTest(operation_mode_e mode, int expected) {
|
|||
eth.setTriggerType(TT_ONE);
|
||||
|
||||
eth.smartFireTriggerEvents2(/*count*/200, /*delay*/ 40);
|
||||
ASSERT_EQ(expected, GET_RPM());
|
||||
ASSERT_EQ(expected, Sensor::getOrZero(SensorType::Rpm));
|
||||
}
|
||||
|
||||
// todo: google test profiles one day?
|
||||
|
|
|
@ -84,7 +84,7 @@ TEST(big, testTriggerInputAdc) {
|
|||
eth.setTriggerType(TT_TOOTHED_WHEEL_60_2);
|
||||
|
||||
ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
|
||||
ASSERT_EQ(0, GET_RPM()) << "testTriggerInputAdc RPM #1";
|
||||
ASSERT_EQ(0, Sensor::getOrZero(SensorType::Rpm)) << "testTriggerInputAdc RPM #1";
|
||||
|
||||
trigAdcState.init();
|
||||
setTriggerAdcMode(TRIGGER_ADC_ADC);
|
||||
|
@ -95,6 +95,6 @@ TEST(big, testTriggerInputAdc) {
|
|||
simulateTrigger(trigAdcState, reader, 2.0f, 3.3f);
|
||||
|
||||
ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
|
||||
ASSERT_EQ(0, GET_RPM()) << "testTriggerInputAdc RPM #2";
|
||||
ASSERT_EQ(0, Sensor::getOrZero(SensorType::Rpm)) << "testTriggerInputAdc RPM #2";
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorTolera
|
|||
// check if we're imitating the 60-2 signal correctly
|
||||
ASSERT_EQ( 0, eth.engine.triggerCentral.triggerState.getCurrentIndex()) << "index #1";
|
||||
// check rpm (60secs / (1000us * 60teeth)) = 1000rpm
|
||||
ASSERT_EQ( 1000, GET_RPM()) << "testNoiselessDecoder RPM";
|
||||
ASSERT_EQ( 1000, Sensor::getOrZero(SensorType::Rpm)) << "testNoiselessDecoder RPM";
|
||||
|
||||
// add noise1 - 1 spike in the middle of the 2nd rising pulse
|
||||
fireNoisyCycle60_2(ð, 2, 1000, 2, 10, 500, 1);
|
||||
|
@ -171,7 +171,7 @@ TEST(big, testNoiselessDecoder) {
|
|||
eth.setTriggerType(TT_TOOTHED_WHEEL_60_2);
|
||||
|
||||
ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
|
||||
ASSERT_EQ( 0, GET_RPM()) << "testNoiselessDecoder RPM";
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "testNoiselessDecoder RPM";
|
||||
|
||||
//printTriggerDebug = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue