explicit RedundantSensor redundancy unit tests (#5085)

This commit is contained in:
Nathan Schulte 2023-02-16 06:18:18 -06:00 committed by GitHub
parent d06fcad154
commit 802f6b47b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 4 deletions

View File

@ -34,6 +34,14 @@ protected:
}
};
TEST_F(SensorRedundant, CheckIsRedundant)
{
// Expect isRedundant
{
EXPECT_TRUE(dut.isRedundant());
}
}
TEST_F(SensorRedundant, SetOnlyOneSensor)
{
// Don't set any sensors - expect invalid
@ -70,8 +78,6 @@ TEST_F(SensorRedundant, SetTwoSensors)
auto result = dut.get();
EXPECT_TRUE(result.Valid);
EXPECT_FLOAT_EQ(result.Value, 25.0f);
EXPECT_TRUE(dut.isRedundant());
}
}
@ -161,6 +167,13 @@ protected:
}
};
TEST_F(SensorRedundantIgnoreSecond, CheckIsRedundant)
{
// Expect not isRedundant
{
EXPECT_FALSE(dut.isRedundant());
}
}
TEST_F(SensorRedundantIgnoreSecond, OnlyFirst)
{
// Don't set any sensors - expect invalid
@ -177,8 +190,6 @@ TEST_F(SensorRedundantIgnoreSecond, OnlyFirst)
auto result = dut.get();
EXPECT_TRUE(result.Valid);
EXPECT_FLOAT_EQ(result.Value, 44.0f);
EXPECT_FALSE(dut.isRedundant());
}
}