2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file test_sensors.cpp
|
|
|
|
*
|
|
|
|
* @date Dec 7, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-08 19:10:54 -08:00
|
|
|
TEST(sensors, mapDecoding) {
|
2021-11-16 13:52:11 -08:00
|
|
|
EngineTestHelper eth(FORD_INLINE_6_1995);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
air_pressure_sensor_config_s s;
|
|
|
|
s.type = MT_DENSO183;
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
assertEqualsM("denso 0 volts", -6.64, decodePressure(0, &s));
|
|
|
|
ASSERT_FLOAT_EQ(31.244, decodePressure(1, &s));
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
s.type = MT_MPX4250;
|
2021-11-16 01:15:29 -08:00
|
|
|
ASSERT_EQ( 8, decodePressure(0, &s)) << "MPX_4250 0 volts";
|
|
|
|
ASSERT_FLOAT_EQ(58.4, decodePressure(1, &s));
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|