This commit is contained in:
rusefi 2019-01-08 22:10:54 -05:00
parent 53709e1ef4
commit f68cb90e6c
11 changed files with 10 additions and 52 deletions

View File

@ -13,6 +13,7 @@
#include "main_trigger_callback.h"
#include "unit_test_framework.h"
/**
* Mock engine with trigger signal simulation infrastructure
*/

View File

@ -12,12 +12,10 @@
#include "test_accel_enrichment.h"
#include "test_interpolation_3d.h"
#include "test_find_index.h"
#include "test_sensors.h"
#include "test_speed_density.h"
#include "test_fuel_map.h"
#include "fuel_math.h"
#include "test_fuelCut.h"
#include "test_logic_expression.h"
#include "test_pid_auto.h"
#include "engine_configuration.h"
@ -68,7 +66,7 @@ GTEST_API_ int main(int argc, char **argv) {
* PID
*/
testPidAuto();
testPidController();
/**
* Larger-scale engine control
*/
@ -82,10 +80,9 @@ GTEST_API_ int main(int argc, char **argv) {
testFasterEngineSpinningUp();
testGpsParser();
testFuelMap();
testFuelCut();
testEngineMath();
testIgnitionPlanning();
testSensors();
/**
* Data structures and general methods
*/

View File

@ -5,17 +5,14 @@
*/
#include "engine_math.h"
#include "test_fuelCut.h"
#include "test_trigger_decoder.h"
#include "event_queue.h"
#include "unit_test_framework.h"
#include "tps.h"
extern EventQueue schedulingQueue;
extern int timeNowUs;
extern EnginePins enginePins;
void testCoastingFuelCut() {
TEST(fuelCut, coasting) {
// this is just a reference unit test implementation
printf("*************************************************** testCoastingFuelCut\r\n");
@ -102,7 +99,3 @@ void testCoastingFuelCut() {
// Fuel cut-off is active again!
assertEqualsM("inj dur#7 cut", 0.0f, ENGINE(injectionDuration));
}
void testFuelCut() {
testCoastingFuelCut();
}

View File

@ -1,14 +0,0 @@
/*
* test_fuelCut.h
*
* Created on: Mar 22, 2018
*/
#ifndef TEST_FUELCUT_H_
#define TEST_FUELCUT_H_
#include "global.h"
void testFuelCut();
#endif /* TEST_FUELCUT_H_ */

View File

@ -7,8 +7,6 @@
#include "unit_test_framework.h"
#include "hip9011_lookup.h"
#include "HIP9011_logic.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
using ::testing::_;
TEST(hip9011, lookup) {

View File

@ -8,7 +8,7 @@
#include "engine_test_helper.h"
#include "pid.h"
void testPidController(void) {
TEST(idle, pid) {
print("******************************************* testPidController\r\n");
pid_s pidS;
pidS.pFactor = 50;

View File

@ -2,6 +2,5 @@
#define TEST_IDLE_CONTROLLER_H
void idleDebug(char *msg, int value);
void testPidController(void);
#endif

View File

@ -10,7 +10,6 @@
#include "pid_auto_tune.h"
#include "unit_test_framework.h"
#include "cyclic_buffer.h"
#include "gtest/gtest.h"
efitimems_t mockTimeMs = 0;

View File

@ -12,7 +12,7 @@
static ThermistorConf tc;
static void testMapDecoding(void) {
TEST(sensors, mapDecoding) {
EngineTestHelper eth(FORD_INLINE_6_1995);
EXPAND_EngineTestHelper;
@ -27,7 +27,7 @@ static void testMapDecoding(void) {
assertEquals(58.4, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX));
}
void testTps(void) {
TEST(sensors, tps) {
print("************************************************** testTps\r\n");
EngineTestHelper eth(DODGE_RAM);
@ -57,11 +57,7 @@ void testTpsRateOfChange(void) {
// assertEquals(25, getTpsRateOfChange());
}
void testSensors(void) {
print("************************************************** testSensors\r\n");
testMapDecoding();
testTps();
testTpsRateOfChange();
TEST(sensors, tm) {
ThermistorMath tm;
{

View File

@ -1,13 +0,0 @@
/**
* @file test_sensors.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef TEST_SENSORS_H_
#define TEST_SENSORS_H_
void testSensors(void);
#endif /* TEST_SENSORS_H_ */

View File

@ -9,6 +9,8 @@
#define UNIT_TEST_FRAMEWORK_H_
#include "engine.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
void assertEqualsM2(const char *msg, float expected, float actual, float EPS);
void assertEqualsM(const char *msg, float expected, float actual);