diff --git a/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.cpp b/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.cpp index 93f1af7c96..b3aca40be4 100644 --- a/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.cpp +++ b/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.cpp @@ -6,6 +6,20 @@ #include "shift_torque_reduction_test_base.h" +ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivatePin( + const std::optional value +) { + m_launchActivatePin = value; + return *this; +} + +ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivateInverted( + const std::optional value +) { + m_launchActivateInverted = value; + return *this; +} + ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductionEnabled( const std::optional value ) { @@ -34,20 +48,6 @@ ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductio return *this; } -ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivatePin( - const std::optional value -) { - m_launchActivatePin = value; - return *this; -} - -ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLaunchActivateInverted( - const std::optional value -) { - m_launchActivateInverted = value; - return *this; -} - ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setLimitTorqueReductionTime(std::optional value) { m_limitTorqueReductionTime = value; return *this; @@ -85,12 +85,15 @@ ShiftTorqueReductionTestConfig ShiftTorqueReductionTestConfig::setTorqueReductio } void ShiftTorqueReductionTestBase::setUpTestConfig(const ShiftTorqueReductionTestConfig& config) { + // Launch Control + getTestEngineConfiguration().configureLaunchActivatePin(config.getLaunchActivatePin()); + getTestEngineConfiguration().configureLaunchActivateInverted(config.getLaunchActivateInverted()); + + // Shift Torque Reduction (Flat Shift) getTestEngineConfiguration().configureTorqueReductionEnabled(config.getTorqueReductionEnabled()); getTestEngineConfiguration().configureTorqueReductionActivationMode(config.getTorqueReductionActivationMode()); getTestEngineConfiguration().configureTorqueReductionTriggerPin(config.getTorqueReductionTriggerPin()); getTestEngineConfiguration().configureTorqueReductionButtonInverted(config.getTorqueReductionTriggerPinInverted()); - getTestEngineConfiguration().configureLaunchActivatePin(config.getLaunchActivatePin()); - getTestEngineConfiguration().configureLaunchActivateInverted(config.getLaunchActivateInverted()); getTestEngineConfiguration().configureLimitTorqueReductionTime(config.getLimitTorqueReductionTime()); getTestEngineConfiguration().configureTorqueReductionTime(config.getTorqueReductionTime()); getTestEngineConfiguration().configureTorqueReductionArmingRpm(config.getTorqueReductionArmingRpm()); diff --git a/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.h b/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.h index 8c02c3e2d2..75731e4810 100644 --- a/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.h +++ b/unit_tests/tests/shift_torque_reduction/shift_torque_reduction_test_base.h @@ -8,14 +8,17 @@ class ShiftTorqueReductionTestConfig { public: + // Launch Control + std::optional getLaunchActivatePin() const { return m_launchActivatePin; } + std::optional getLaunchActivateInverted() const { return m_launchActivateInverted; } + + // Shift Torque Reduction (Flat Shift) std::optional getTorqueReductionEnabled() const { return m_isTorqueReductionEnabled; } std::optional getTorqueReductionActivationMode() const { return m_torqueReductionActivationMode; } std::optional getTorqueReductionTriggerPin() const { return m_torqueReductionTriggerPin; } std::optional getTorqueReductionTriggerPinInverted() const { return m_torqueReductionTriggerPinInverted; } - std::optional getLaunchActivatePin() const { return m_launchActivatePin; } - std::optional getLaunchActivateInverted() const { return m_launchActivateInverted; } std::optional getLimitTorqueReductionTime() const { return m_limitTorqueReductionTime; } std::optional getTorqueReductionTime() const { return m_torqueReductionTime; } std::optional getTorqueReductionArmingRpm() const { return m_torqueReductionArmingRpm; } @@ -25,14 +28,18 @@ public: // We do not core about performance in tests, but we want to use builder-like style, so setters return new instance // of configuration: + + // Launch Control + ShiftTorqueReductionTestConfig setLaunchActivatePin(std::optional value); + ShiftTorqueReductionTestConfig setLaunchActivateInverted(std::optional value); + + // Shift Torque Reduction (Flat Shift) ShiftTorqueReductionTestConfig setTorqueReductionEnabled(std::optional value); ShiftTorqueReductionTestConfig setTorqueReductionActivationMode( std::optional value ); ShiftTorqueReductionTestConfig setTorqueReductionTriggerPin(std::optional value); ShiftTorqueReductionTestConfig setTorqueReductionTriggerPinInverted(std::optional value); - ShiftTorqueReductionTestConfig setLaunchActivatePin(std::optional value); - ShiftTorqueReductionTestConfig setLaunchActivateInverted(std::optional value); ShiftTorqueReductionTestConfig setLimitTorqueReductionTime(std::optional value); ShiftTorqueReductionTestConfig setTorqueReductionTime(std::optional value); ShiftTorqueReductionTestConfig setTorqueReductionArmingRpm(std::optional value); @@ -40,12 +47,15 @@ public: ShiftTorqueReductionTestConfig setTorqueReductionIgnitionCut(std::optional value); ShiftTorqueReductionTestConfig setTorqueReductionIgnitionRetard(std::optional value); private: + // Launch Control + std::optional m_launchActivatePin; + std::optional m_launchActivateInverted; + + // Shift Torque Reduction (Flat Shift) std::optional m_isTorqueReductionEnabled; std::optional m_torqueReductionActivationMode; std::optional m_torqueReductionTriggerPin; std::optional m_torqueReductionTriggerPinInverted; - std::optional m_launchActivatePin; - std::optional m_launchActivateInverted; std::optional m_limitTorqueReductionTime; std::optional m_torqueReductionTime; std::optional m_torqueReductionArmingRpm;