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
|
|
|
*/
|
|
|
|
|
2018-09-16 19:39:46 -07:00
|
|
|
#include "global.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "thermistors.h"
|
|
|
|
#include "allsensors.h"
|
|
|
|
#include "engine_test_helper.h"
|
|
|
|
|
2019-01-08 19:10:54 -08:00
|
|
|
TEST(sensors, mapDecoding) {
|
2019-01-19 17:42:29 -08:00
|
|
|
WITH_ENGINE_TEST_HELPER(FORD_INLINE_6_1995);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
air_pressure_sensor_config_s s;
|
|
|
|
s.type = MT_DENSO183;
|
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
assertEqualsM("denso 0 volts", -6.64, decodePressure(0, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
2019-01-14 15:20:20 -08:00
|
|
|
ASSERT_FLOAT_EQ(31.244, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
s.type = MT_MPX4250;
|
2019-01-14 15:38:20 -08:00
|
|
|
ASSERT_EQ( 8, decodePressure(0, &s PASS_ENGINE_PARAMETER_SUFFIX)) << "MPX_4250 0 volts";
|
2019-01-14 15:20:20 -08:00
|
|
|
ASSERT_FLOAT_EQ(58.4, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX));
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|