From 7cd5ea855c3b574febe893ff0fbd1dc827a97ed3 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 5 Jul 2021 20:56:24 -0400 Subject: [PATCH] restore testQuadCam #2911 --- unit_tests/tests/trigger/test_quad_cam.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unit_tests/tests/trigger/test_quad_cam.cpp b/unit_tests/tests/trigger/test_quad_cam.cpp index 9b188b99cc..e54d75f9da 100644 --- a/unit_tests/tests/trigger/test_quad_cam.cpp +++ b/unit_tests/tests/trigger/test_quad_cam.cpp @@ -41,15 +41,18 @@ TEST(trigger, testQuadCam) { float d = 4; + int firstCam = 0; int secondCam = 1; // this would be ignored since we only consume the other kind of fronts here hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); eth.moveTimeForwardUs(MS2US(20 / d)); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCam PASS_ENGINE_PARAMETER_SUFFIX); // this would be be first VVT signal - gap duration would be calculated against 'DEEP_IN_THE_PAST_SECONDS' initial value hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); eth.moveTimeForwardUs(MS2US(20 / d)); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); // this second important front would give us first real VVT gap duration hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); @@ -60,7 +63,7 @@ TEST(trigger, testQuadCam) { // this third important front would give us first comparison between two real gaps hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_NEAR(-67.6 - 720 - 720 + 160.2, engine->triggerCentral.getVVTPosition(0, 1), EPS3D); + ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(0, 1), EPS3D); // actually position based on VVT! ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); @@ -85,7 +88,7 @@ TEST(trigger, testQuadCam) { // this third important front would give us first comparison between two real gaps hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_NEAR(-2571.4, engine->triggerCentral.getVVTPosition(secondBank, secondCam), EPS3D); + ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(secondBank, secondCam), EPS3D); // actually position based on VVT! ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter());