rusefi/unit_tests/tests/ac/ac_test_base.h

38 lines
1.3 KiB
C
Raw Normal View History

2024-06-18 08:42:16 -07:00
//
// Created by kifir on 6/18/24.
//
#pragma once
#include "util/test_base.h"
class AcTestConfig {
public:
2024-06-19 11:48:08 -07:00
std::optional<float> getAcDelay() const { return m_acDelay; }
2024-06-18 08:42:16 -07:00
std::optional<uint16_t> getMinAcPressure() const { return m_minAcPressure; }
std::optional<uint16_t> getMaxAcPressure() const { return m_maxAcPressure; }
protected:
2024-06-19 11:48:08 -07:00
void setAcDelay(const std::optional<float> value) { m_acDelay = value; }
2024-06-18 08:42:16 -07:00
void setMinAcPressure(const std::optional<uint16_t> value) { m_minAcPressure = value; }
void setMaxAcPressure(const std::optional<uint16_t> value) { m_maxAcPressure = value; }
private:
2024-06-19 11:48:08 -07:00
std::optional<float> m_acDelay;
2024-06-18 08:42:16 -07:00
std::optional<uint16_t> m_minAcPressure;
std::optional<uint16_t> m_maxAcPressure;
};
class AcTestBase : public TestBase {
protected:
constexpr static double DEFAULT_AC_DELAY = 0.5f;
constexpr static uint16_t DEFAULT_MIN_AC_PRESSURE = 100;
constexpr static uint16_t DEFAULT_MAX_AC_PRESSURE = 300;
2024-06-18 08:42:16 -07:00
void updateAcPressure(float acPressure);
void setUpTestConfig(const AcTestConfig& config);
private:
2024-06-19 11:48:08 -07:00
void configureAcDelay(const std::optional<float> acDelay);
2024-06-18 08:42:16 -07:00
void configureMinAcPressure(const std::optional<uint16_t> minAcPressure);
void configureMaxAcPressure(const std::optional<uint16_t> maxAcPressure);
};