launch control: Speed threshold depends on launch mode, also zero speed limit handling #5419

only:TDD
This commit is contained in:
Andrey 2023-07-20 16:05:16 -04:00
parent 13d4475986
commit 3c090129e6
1 changed files with 34 additions and 0 deletions

View File

@ -40,6 +40,40 @@ TEST(LaunchControl, VSSCondition) {
}
TEST(LaunchControl, ZeroVSSCondition) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
// Test Speed threshold
engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH;
engineConfiguration->launchSpeedThreshold = 0;
Sensor::setMockValue(SensorType::VehicleSpeed, 10.0);
EXPECT_FALSE(dut.isInsideSpeedCondition());
}
TEST(LaunchControl, VSSConditionWithSwitch) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
LaunchControlBase dut;
// Test Speed threshold
engineConfiguration->launchActivationMode = SWITCH_INPUT_LAUNCH;
engineConfiguration->launchActivatePin = Gpio::G1;
setMockState(engineConfiguration->launchActivatePin, true);
engineConfiguration->launchSpeedThreshold = 30;
Sensor::setMockValue(SensorType::VehicleSpeed, 10.0);
EXPECT_TRUE(dut.isInsideSpeedCondition());
Sensor::setMockValue(SensorType::VehicleSpeed, 40.0);
EXPECT_TRUE(dut.isInsideSpeedCondition());
}
TEST(LaunchControl, RPMCondition) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);