From a0e4433d62934c4196754d7d2f7bfa5e1c627092 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Mon, 2 Mar 2015 21:04:23 -0600 Subject: [PATCH] auto-sync --- unit_tests/main.cpp | 2 ++ unit_tests/test_idle_controller.cpp | 11 +++++++++++ unit_tests/test_idle_controller.h | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 019f2b91ff..39460fe61d 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -145,6 +145,8 @@ int main(void) { testMafLookup(); testMafFuelMath(); + testPidController(); + // resizeMap(); printf("Success 20150213\r\n"); return EXIT_SUCCESS; diff --git a/unit_tests/test_idle_controller.cpp b/unit_tests/test_idle_controller.cpp index e1e46e073d..9124563ad0 100644 --- a/unit_tests/test_idle_controller.cpp +++ b/unit_tests/test_idle_controller.cpp @@ -9,6 +9,7 @@ #include "idle_controller.h" #include "efitime.h" #include "engine_test_helper.h" +#include "pid.h" void idleDebug(const char *msg, percent_t value) { printf("%s\r\n", msg); @@ -17,6 +18,7 @@ void idleDebug(const char *msg, percent_t value) { static IdleValveState is; void testIdleController(void) { + print("******************************************* testIdleController\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); Engine *engine = ð.engine; engine_configuration_s *engineConfiguration = engine->engineConfiguration; @@ -35,3 +37,12 @@ void testIdleController(void) { time += 2000; assertEquals(60.6, is.getIdle(1050, time PASS_ENGINE_PARAMETER)); } + +void testPidController(void) { + print("******************************************* testPidController\r\n"); + Pid pid(50, 0.5, 0, 10, 90); + + assertEquals(90, pid.getValue(14, 12, 0.1)); + + +} diff --git a/unit_tests/test_idle_controller.h b/unit_tests/test_idle_controller.h index 9736c08151..6e0cdaf904 100644 --- a/unit_tests/test_idle_controller.h +++ b/unit_tests/test_idle_controller.h @@ -3,6 +3,6 @@ void testIdleController(void); void idleDebug(char *msg, int value); -//bool_t isCranking(void); +void testPidController(void); #endif