From 73b12b6858fc63802009936fbae304e2ce1efef7 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 7 Apr 2017 15:12:49 -0400 Subject: [PATCH] #388 test --- .../simulator/rusEfiFunctionalTest.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp b/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp index 7e6b5b7e6c..4b8100c139 100644 --- a/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp +++ b/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp @@ -55,7 +55,7 @@ float getMap(void) { return getRawMap(); } -static void runChprintfTess() { +static void runChprintfTest() { static MemoryStream testStream; static char testBuffer[200]; msObjectInit(&testStream, (uint8_t *) testBuffer, sizeof(testBuffer), 0); @@ -70,6 +70,19 @@ static void runChprintfTess() { if (strcmp(FLOAT_STRING_EXPECTED, testBuffer) != 0) { firmwareError(OBD_PCM_Processor_Fault, "chprintf test: got %s while %s", testBuffer, FLOAT_STRING_EXPECTED); } + + { + LoggingWithStorage testLogging("test"); + appendFloat(&testLogging, 1.23, 5); + appendFloat(&testLogging, 1.234, 2); + +#define FLOAT_STRING_EXPECTED2 "1.230001.23" + if (strcmp(FLOAT_STRING_EXPECTED2, testLogging.buffer) != 0) { + firmwareError(OBD_PCM_Processor_Fault, "chprintf test2: got %s while %s", testLogging.buffer, FLOAT_STRING_EXPECTED2); + } + + } + } void rusEfiFunctionalTest(void) { @@ -113,7 +126,7 @@ void rusEfiFunctionalTest(void) { startStatusThreads(engine); - runChprintfTess(); + runChprintfTest(); initPeriodicEvents(PASS_ENGINE_PARAMETER_F);