2019-01-03 04:57:34 -08:00
|
|
|
/*
|
|
|
|
* test_cj125.cpp
|
|
|
|
*
|
|
|
|
* Created on: Jan 3, 2019
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2019
|
|
|
|
*/
|
|
|
|
|
2019-01-03 17:14:23 -08:00
|
|
|
#include "gtest/gtest.h"
|
2019-02-01 20:16:34 -08:00
|
|
|
#include "CJ125_logic.h"
|
|
|
|
#include "engine_test_helper.h"
|
|
|
|
|
2019-02-01 20:48:11 -08:00
|
|
|
static void applyHeaterPinState(PwmConfig *state, int stateIndex) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-02-01 20:16:34 -08:00
|
|
|
TEST(testCJ125, testInitialState) {
|
|
|
|
CJ125 cj;
|
|
|
|
|
|
|
|
ASSERT_EQ(cj.state, CJ125_INIT);
|
|
|
|
ASSERT_FALSE(cj.isWorkingState());
|
2019-02-01 20:48:11 -08:00
|
|
|
ASSERT_EQ(cj.heaterDuty, 0);
|
2019-02-01 20:16:34 -08:00
|
|
|
|
|
|
|
WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996);
|
|
|
|
ASSERT_EQ(engine->sensors.vBatt, 0);
|
2019-01-03 04:57:34 -08:00
|
|
|
|
2019-02-01 20:48:11 -08:00
|
|
|
cj.StartHeaterControl(&applyHeaterPinState PASS_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
ASSERT_EQ(cj.heaterDuty, CJ125_HEATER_IDLE_RATE);
|
|
|
|
|
2019-01-03 04:57:34 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|