From 992570f3226844faecd03cf071037b6d2f189aff Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 4 Jul 2021 14:52:45 -0700 Subject: [PATCH] explicitly set mock vss to test (#2905) --- unit_tests/tests/test_idle_controller.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/unit_tests/tests/test_idle_controller.cpp b/unit_tests/tests/test_idle_controller.cpp index 5483c0aa2a..4ab583c9aa 100644 --- a/unit_tests/tests/test_idle_controller.cpp +++ b/unit_tests/tests/test_idle_controller.cpp @@ -15,6 +15,7 @@ #include "engine_controller.h" #include "electronic_throttle.h" #include "sensor.h" +#include "vehicle_speed.h" using ::testing::StrictMock; using ::testing::_; @@ -402,6 +403,7 @@ TEST(idle_v2, IntegrationManual) { float expectedClt = 37; Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value); Sensor::setMockValue(SensorType::Clt, expectedClt); + setMockVehicleSpeed(15); ENGINE(rpmCalculator.mockRpm) = 950; // Target of 1000 rpm @@ -409,7 +411,7 @@ TEST(idle_v2, IntegrationManual) { .WillOnce(Return(1000)); // Determine phase will claim we're idling - EXPECT_CALL(dut, determinePhase(950, 1000, expectedTps, 0)) + EXPECT_CALL(dut, determinePhase(950, 1000, expectedTps, 15)) .WillOnce(Return(ICP::Idling)); // Open loop should be asked for an open loop position @@ -432,6 +434,7 @@ TEST(idle_v2, IntegrationAutomatic) { float expectedClt = 37; Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value); Sensor::setMockValue(SensorType::Clt, expectedClt); + setMockVehicleSpeed(15); ENGINE(rpmCalculator.mockRpm) = 950; // Target of 1000 rpm @@ -439,7 +442,7 @@ TEST(idle_v2, IntegrationAutomatic) { .WillOnce(Return(1000)); // Determine phase will claim we're idling - EXPECT_CALL(dut, determinePhase(950, 1000, expectedTps, 0)) + EXPECT_CALL(dut, determinePhase(950, 1000, expectedTps, 15)) .WillOnce(Return(ICP::Idling)); // Open loop should be asked for an open loop position @@ -465,6 +468,7 @@ TEST(idle_v2, IntegrationClamping) { float expectedClt = 37; Sensor::setMockValue(SensorType::DriverThrottleIntent, expectedTps.Value); Sensor::setMockValue(SensorType::Clt, expectedClt); + setMockVehicleSpeed(15); ENGINE(rpmCalculator.mockRpm) = 950; // Target of 1000 rpm @@ -472,7 +476,7 @@ TEST(idle_v2, IntegrationClamping) { .WillOnce(Return(1000)); // Determine phase will claim we're idling - EXPECT_CALL(dut, determinePhase(950, 1000, expectedTps, 0)) + EXPECT_CALL(dut, determinePhase(950, 1000, expectedTps, 15)) .WillOnce(Return(ICP::Idling)); // Open loop should be asked for an open loop position