get rid of redundant acDelay initialization (actually it is not needed for this test) #6570
This commit is contained in:
parent
bd2beb185f
commit
400fb7a3ac
|
@ -13,26 +13,16 @@ namespace {
|
||||||
|
|
||||||
class AcPressureTestConfig : public AcTestConfig {
|
class AcPressureTestConfig : public AcTestConfig {
|
||||||
public:
|
public:
|
||||||
AcPressureTestConfig();
|
|
||||||
AcPressureTestConfig(
|
AcPressureTestConfig(
|
||||||
const std::optional<float> acDelay,
|
|
||||||
const std::optional<uint16_t> minAcPressure,
|
const std::optional<uint16_t> minAcPressure,
|
||||||
const std::optional<uint16_t> maxAcPressure
|
const std::optional<uint16_t> maxAcPressure
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
AcPressureTestConfig::AcPressureTestConfig(): AcPressureTestConfig {
|
|
||||||
{ 0.0f },
|
|
||||||
{ TEST_MIN_AC_PRESSURE },
|
|
||||||
{ TEST_MAX_AC_PRESSURE }
|
|
||||||
} {}
|
|
||||||
|
|
||||||
AcPressureTestConfig::AcPressureTestConfig(
|
AcPressureTestConfig::AcPressureTestConfig(
|
||||||
const std::optional<float> acDelay,
|
|
||||||
const std::optional<uint16_t> minAcPressure,
|
const std::optional<uint16_t> minAcPressure,
|
||||||
const std::optional<uint16_t> maxAcPressure
|
const std::optional<uint16_t> maxAcPressure
|
||||||
) {
|
) {
|
||||||
setAcDelay(acDelay);
|
|
||||||
setMinAcPressure(minAcPressure);
|
setMinAcPressure(minAcPressure);
|
||||||
setMaxAcPressure(maxAcPressure);
|
setMaxAcPressure(maxAcPressure);
|
||||||
}
|
}
|
||||||
|
@ -46,11 +36,21 @@ namespace {
|
||||||
|
|
||||||
class AcPressureTest : public AcTestBase {
|
class AcPressureTest : public AcTestBase {
|
||||||
protected:
|
protected:
|
||||||
|
static const AcPressureTestConfig DEFAULT_AC_PRESSURE_CONFIG;
|
||||||
|
static const AcPressureTestConfig TEST_AC_PRESSURE_CONFIG;
|
||||||
|
|
||||||
void doTest(const AcPressureTestConfig& config, const std::vector<AcPressureTestData>& testData);
|
void doTest(const AcPressureTestConfig& config, const std::vector<AcPressureTestData>& testData);
|
||||||
private:
|
private:
|
||||||
void checkPersistentIndicators();
|
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<AcPressureTestData>& testData) {
|
void AcPressureTest::doTest(const AcPressureTestConfig& config, const std::vector<AcPressureTestData>& testData) {
|
||||||
setUpTestConfig(config);
|
setUpTestConfig(config);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ namespace {
|
||||||
|
|
||||||
TEST_F(AcPressureTest, pressureTooLow) {
|
TEST_F(AcPressureTest, pressureTooLow) {
|
||||||
doTest(
|
doTest(
|
||||||
/* config = */ {},
|
/* config = */ TEST_AC_PRESSURE_CONFIG,
|
||||||
/* testData = */ {
|
/* testData = */ {
|
||||||
{
|
{
|
||||||
"acPressure = (TEST_MIN_AC_PRESSURE + TEST_MAX_AC_PRESSURE) / 2.0",
|
"acPressure = (TEST_MIN_AC_PRESSURE + TEST_MAX_AC_PRESSURE) / 2.0",
|
||||||
|
@ -136,7 +136,7 @@ namespace {
|
||||||
|
|
||||||
TEST_F(AcPressureTest, pressureTooHigh) {
|
TEST_F(AcPressureTest, pressureTooHigh) {
|
||||||
doTest(
|
doTest(
|
||||||
/* config = */ {},
|
/* config = */ TEST_AC_PRESSURE_CONFIG,
|
||||||
/* testData = */ {
|
/* testData = */ {
|
||||||
{
|
{
|
||||||
"acPressure = (TEST_MIN_AC_PRESSURE + TEST_MAX_AC_PRESSURE) / 2.0",
|
"acPressure = (TEST_MIN_AC_PRESSURE + TEST_MAX_AC_PRESSURE) / 2.0",
|
||||||
|
@ -180,7 +180,7 @@ namespace {
|
||||||
|
|
||||||
TEST_F(AcPressureTest, defaultMinAcPressure) {
|
TEST_F(AcPressureTest, defaultMinAcPressure) {
|
||||||
doTest(
|
doTest(
|
||||||
/* config = */ { {}, {}, {}},
|
/* config = */ DEFAULT_AC_PRESSURE_CONFIG,
|
||||||
/* testData = */ {
|
/* testData = */ {
|
||||||
{
|
{
|
||||||
"acPressure = (DEFAULT_MIN_AC_PRESSURE + DEFAULT_MAX_AC_PRESSURE) / 2.0",
|
"acPressure = (DEFAULT_MIN_AC_PRESSURE + DEFAULT_MAX_AC_PRESSURE) / 2.0",
|
||||||
|
@ -224,7 +224,7 @@ namespace {
|
||||||
|
|
||||||
TEST_F(AcPressureTest, defaultMaxAcPressure) {
|
TEST_F(AcPressureTest, defaultMaxAcPressure) {
|
||||||
doTest(
|
doTest(
|
||||||
/* config = */ { {}, {}, {} },
|
/* config = */ DEFAULT_AC_PRESSURE_CONFIG,
|
||||||
/* testData = */ {
|
/* testData = */ {
|
||||||
{
|
{
|
||||||
"acPressure = (DEFAULT_MIN_AC_PRESSURE + DEFAULT_MAX_AC_PRESSURE) / 2.0",
|
"acPressure = (DEFAULT_MIN_AC_PRESSURE + DEFAULT_MAX_AC_PRESSURE) / 2.0",
|
||||||
|
|
Loading…
Reference in New Issue