explicitly set mock vss to test (#2905)

This commit is contained in:
Matthew Kennedy 2021-07-04 14:52:45 -07:00 committed by GitHub
parent f12b414057
commit 992570f322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -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