rusefi/unit_tests/test_basic_math/test_find_index.cpp

30 lines
734 B
C++
Raw Normal View History

2015-07-10 06:01:56 -07:00
/*
* test_find_index.cpp
*
* Created on: Oct 30, 2013
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
#include "pch.h"
#include "efi_interpolation.h"
2015-07-10 06:01:56 -07:00
2019-01-14 12:31:56 -08:00
TEST(misc, testSetTableValue) {
2015-07-10 06:01:56 -07:00
printf("*************************************************** testSetTableValue\r\n");
persistent_config_s config;
for (int i = 0; i < CLT_CURVE_SIZE; i++) {
config.cltFuelCorrBins[i] = -40 + i * 10;
config.cltFuelCorr[i] = 1;
}
2019-01-14 15:00:59 -08:00
ASSERT_EQ(1, config.cltFuelCorr[0]);
2015-07-10 06:01:56 -07:00
2017-06-11 12:12:41 -07:00
setCurveValue(config.cltFuelCorrBins, config.cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
2019-01-14 15:20:20 -08:00
ASSERT_FLOAT_EQ(1.5, config.cltFuelCorr[0]);
2015-07-10 06:01:56 -07:00
2017-06-11 12:12:41 -07:00
setCurveValue(config.cltFuelCorrBins, config.cltFuelCorr, CLT_CURVE_SIZE, -50, 1.4);
2019-01-14 15:20:20 -08:00
ASSERT_FLOAT_EQ(1.4, config.cltFuelCorr[0]);
2015-07-10 06:01:56 -07:00
}