From 9dfc066bce71f7842ee5ac8cc8fdfc5cfb983910 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 8 Jul 2021 00:11:38 -0400 Subject: [PATCH] restore testQuadCam #2911 --- unit_tests/tests/trigger/test_quad_cam.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/unit_tests/tests/trigger/test_quad_cam.cpp b/unit_tests/tests/trigger/test_quad_cam.cpp index 0a87e0eedb..e34a628d7b 100644 --- a/unit_tests/tests/trigger/test_quad_cam.cpp +++ b/unit_tests/tests/trigger/test_quad_cam.cpp @@ -10,7 +10,6 @@ TEST(trigger, testQuadCam) { WITH_ENGINE_TEST_HELPER(FORD_ESCORT_GT); // changing to 'ONE TOOTH' trigger on CRANK with CAM/VVT -// setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->useOnlyRisingEdgeForTrigger = true; engineConfiguration->vvtMode[0] = VVT_2JZ; engineConfiguration->vvtMode[1] = VVT_MIATA_NB2; @@ -56,20 +55,20 @@ TEST(trigger, testQuadCam) { // this second important front would give us first real VVT gap duration hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, 0)); + ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, firstCam)); ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); eth.moveTimeForwardUs(MS2US(130 / d)); // this third important front would give us first comparison between two real gaps hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(0, 1), EPS3D); + ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(0, secondCam), EPS3D); // actually position based on VVT! ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); - int secondCamSecondBank = 3; int secondBank = 1; + int secondCamSecondBank = secondBank * CAMS_PER_BANK + secondCam; // this would be ignored since we only consume the other kind of fronts here hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); @@ -81,7 +80,7 @@ TEST(trigger, testQuadCam) { // this second important front would give us first real VVT gap duration hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, 0)); + ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, firstCam)); ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); eth.moveTimeForwardUs(MS2US(130 / d));