Skip to content

Commit

Permalink
test sensor raw value
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Jan 8, 2025
1 parent a8cd9f7 commit 34a1b07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unit_tests/tests/sensor/func_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ TEST_F(SensorConverted, TestValid) {
auto s = Sensor::get(SensorType::Clt);
EXPECT_TRUE(s.Valid);
EXPECT_FLOAT_EQ(s.Value, 50);
EXPECT_FLOAT_EQ(Sensor::getRaw(SensorType::Clt), 25);
}
}

Expand All @@ -65,4 +66,7 @@ TEST_F(SensorConverted, TestInvalid) {
auto s = Sensor::get(SensorType::Clt);
EXPECT_FALSE(s.Valid);
}

// Raw value works even when sensor is invalid
EXPECT_FLOAT_EQ(Sensor::getRaw(SensorType::Clt), -25);
}

0 comments on commit 34a1b07

Please sign in to comment.