diff --git a/unit_tests/tests/ac/ac_pressure_test.cpp b/unit_tests/tests/ac/ac_pressure_test.cpp index db73992bcb..59c709331d 100644 --- a/unit_tests/tests/ac/ac_pressure_test.cpp +++ b/unit_tests/tests/ac/ac_pressure_test.cpp @@ -13,26 +13,16 @@ namespace { class AcPressureTestConfig : public AcTestConfig { public: - AcPressureTestConfig(); AcPressureTestConfig( - const std::optional acDelay, const std::optional minAcPressure, const std::optional maxAcPressure ); }; - AcPressureTestConfig::AcPressureTestConfig(): AcPressureTestConfig { - { 0.0f }, - { TEST_MIN_AC_PRESSURE }, - { TEST_MAX_AC_PRESSURE } - } {} - AcPressureTestConfig::AcPressureTestConfig( - const std::optional acDelay, const std::optional minAcPressure, const std::optional maxAcPressure ) { - setAcDelay(acDelay); setMinAcPressure(minAcPressure); setMaxAcPressure(maxAcPressure); } @@ -46,11 +36,21 @@ namespace { class AcPressureTest : public AcTestBase { protected: + static const AcPressureTestConfig DEFAULT_AC_PRESSURE_CONFIG; + static const AcPressureTestConfig TEST_AC_PRESSURE_CONFIG; + void doTest(const AcPressureTestConfig& config, const std::vector& testData); private: void checkPersistentIndicators(); }; + const AcPressureTestConfig AcPressureTest::DEFAULT_AC_PRESSURE_CONFIG = { {}, {} }; + + const AcPressureTestConfig AcPressureTest::TEST_AC_PRESSURE_CONFIG = { + { TEST_MIN_AC_PRESSURE }, + { TEST_MAX_AC_PRESSURE } + }; + void AcPressureTest::doTest(const AcPressureTestConfig& config, const std::vector& testData) { setUpTestConfig(config); @@ -92,7 +92,7 @@ namespace { TEST_F(AcPressureTest, pressureTooLow) { doTest( - /* config = */ {}, + /* config = */ TEST_AC_PRESSURE_CONFIG, /* testData = */ { { "acPressure = (TEST_MIN_AC_PRESSURE + TEST_MAX_AC_PRESSURE) / 2.0", @@ -136,7 +136,7 @@ namespace { TEST_F(AcPressureTest, pressureTooHigh) { doTest( - /* config = */ {}, + /* config = */ TEST_AC_PRESSURE_CONFIG, /* testData = */ { { "acPressure = (TEST_MIN_AC_PRESSURE + TEST_MAX_AC_PRESSURE) / 2.0", @@ -180,7 +180,7 @@ namespace { TEST_F(AcPressureTest, defaultMinAcPressure) { doTest( - /* config = */ { {}, {}, {}}, + /* config = */ DEFAULT_AC_PRESSURE_CONFIG, /* testData = */ { { "acPressure = (DEFAULT_MIN_AC_PRESSURE + DEFAULT_MAX_AC_PRESSURE) / 2.0", @@ -224,7 +224,7 @@ namespace { TEST_F(AcPressureTest, defaultMaxAcPressure) { doTest( - /* config = */ { {}, {}, {} }, + /* config = */ DEFAULT_AC_PRESSURE_CONFIG, /* testData = */ { { "acPressure = (DEFAULT_MIN_AC_PRESSURE + DEFAULT_MAX_AC_PRESSURE) / 2.0",