Skip to content

Commit

Permalink
assert SensorResult code in RedundantSensor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nmschulte committed Jun 3, 2024
1 parent 49d7006 commit 7fd6b9f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions unit_tests/tests/sensor/redundant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ TEST_F(SensorRedundant, SetOnlyOneSensor)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Inconsistent);
}

// Set one sensor
Expand All @@ -65,6 +66,7 @@ TEST_F(SensorRedundant, SetTwoSensors)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Inconsistent);
}

// Set one sensor
Expand Down Expand Up @@ -179,6 +181,7 @@ TEST_F(SensorRedundantIgnoreSecond, OnlyFirst)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Unknown);
}

// Set one sensor
Expand All @@ -198,6 +201,7 @@ TEST_F(SensorRedundantIgnoreSecond, OnlySecond)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Unknown);
}

// Set second sensor only
Expand All @@ -216,6 +220,7 @@ TEST_F(SensorRedundantIgnoreSecond, SetBothIgnoreSecond)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Unknown);
}

// Set both sensors
Expand Down Expand Up @@ -274,6 +279,7 @@ TEST_F(SensorRedundantPartialSecond, SetOnlyOneSensor)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Inconsistent);
}

// Set first sensor
Expand All @@ -292,6 +298,7 @@ TEST_F(SensorRedundantPartialSecond, SetTwoSensors)
{
auto result = dut.get();
EXPECT_FALSE(result.Valid);
EXPECT_EQ(result.Code, UnexpectedCode::Inconsistent);
}

// Set first sensor
Expand Down

0 comments on commit 7fd6b9f

Please sign in to comment.