From 4f5a2bdc3548ee582ebc46cc28a8d473078c9cc5 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Mon, 3 Feb 2020 17:36:07 +1100 Subject: [PATCH] Fix for failing test_corrections_WUE_active on blank board --- speeduino/init.ino | 1 - speeduino/speeduino.ino | 1 + test/tests_corrections.cpp | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/speeduino/init.ino b/speeduino/init.ino index a0bf3ccb..1ba005ae 100644 --- a/speeduino/init.ino +++ b/speeduino/init.ino @@ -18,7 +18,6 @@ void initialiseAll() { - initialisationComplete = false; //Tracks whether the setup() function has run completely fpPrimed = false; pinMode(LED_BUILTIN, OUTPUT); diff --git a/speeduino/speeduino.ino b/speeduino/speeduino.ino index 3d344754..7609966b 100644 --- a/speeduino/speeduino.ino +++ b/speeduino/speeduino.ino @@ -40,6 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef UNIT_TEST // Scope guard for unit testing void setup() { + initialisationComplete = false; //Tracks whether the initialiseAll() function has run completely initialiseAll(); } diff --git a/test/tests_corrections.cpp b/test/tests_corrections.cpp index 6407dd55..f44b834e 100644 --- a/test/tests_corrections.cpp +++ b/test/tests_corrections.cpp @@ -25,6 +25,7 @@ void test_corrections_WUE_active(void) { //Check for WUE being active currentStatus.coolant = 0; + ((uint8_t*)WUETable.axisX)[9] = 120 + CALIBRATION_TEMPERATURE_OFFSET; //Set a WUE end value of 120 correctionWUE(); TEST_ASSERT_BIT_HIGH(BIT_ENGINE_WARMUP, currentStatus.engine); } @@ -33,6 +34,7 @@ void test_corrections_WUE_inactive(void) { //Check for WUE being inactive due to the temp being too high currentStatus.coolant = 200; + ((uint8_t*)WUETable.axisX)[9] = 120 + CALIBRATION_TEMPERATURE_OFFSET; //Set a WUE end value of 120 correctionWUE(); TEST_ASSERT_BIT_LOW(BIT_ENGINE_WARMUP, currentStatus.engine); }