Revert "Fix sensor mocking bug (#956)"

This reverts commit 217081c1
This commit is contained in:
rusEfi 2019-09-27 20:33:45 -04:00
parent 217081c174
commit dfd5b11c8f
2 changed files with 0 additions and 26 deletions

View File

@ -35,7 +35,6 @@ bool Sensor::Register() {
auto &entry = s_sensorRegistry[i];
entry.sensor = nullptr;
entry.useMock = false;
entry.mockValue = 0.0f;
}
}

View File

@ -90,28 +90,3 @@ TEST_F(SensorMocking, ResetAll) {
EXPECT_FLOAT_EQ(result.Value, 46.0f);
}
}
TEST_F(SensorMocking, ResetWithResetRegistry) {
// Set a value on the "real" sensor
realSensor.set(46.0f);
// Now set a mock value
Sensor::setMockValue(SensorType::Clt, 33.0f);
// Expect to see the mock value
{
auto result = Sensor::get(SensorType::Clt);
EXPECT_TRUE(result.Valid);
EXPECT_FLOAT_EQ(result.Value, 33.0f);
}
// Reset registry - including mocks
Sensor::resetRegistry();
{
auto result = Sensor::get(SensorType::Clt);
EXPECT_TRUE(result.Valid);
EXPECT_FLOAT_EQ(result.Value, 46.0f);
}
}