From 4f416453b19f47a7cc71090f30be39c9afbcf6d0 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 25 Dec 2018 17:26:36 -0500 Subject: [PATCH] nicer test messages --- unit_tests/test_accel_enrichment.cpp | 2 +- unit_tests/test_fuel_map.cpp | 4 ++-- unit_tests/test_trigger_decoder.cpp | 4 +++- unit_tests/test_trigger_noiseless.cpp | 14 +++++++------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/unit_tests/test_accel_enrichment.cpp b/unit_tests/test_accel_enrichment.cpp index 889f36cf45..acb1904efb 100644 --- a/unit_tests/test_accel_enrichment.cpp +++ b/unit_tests/test_accel_enrichment.cpp @@ -13,7 +13,7 @@ #include "engine_test_helper.h" void testAccelEnrichment(void) { - printf("*************************************************** testAccelEnrichment\r\n"); + printf("====================================================================================== testAccelEnrichment\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); EXPAND_EngineTestHelper; diff --git a/unit_tests/test_fuel_map.cpp b/unit_tests/test_fuel_map.cpp index 0731181be1..ccaffd562b 100644 --- a/unit_tests/test_fuel_map.cpp +++ b/unit_tests/test_fuel_map.cpp @@ -20,7 +20,7 @@ extern float testMafValue; void testMafFuelMath(void) { - printf("*************************************************** testMafFuelMath\r\n"); + printf("====================================================================================== testMafFuelMath\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); EXPAND_EngineTestHelper; @@ -34,7 +34,7 @@ void testMafFuelMath(void) { } void testFuelMap(void) { - printf("*************************************************** testFuelMap\r\n"); + printf("====================================================================================== testFuelMap\r\n"); printf("Setting up FORD_ASPIRE_1996\r\n"); EngineTestHelper eth(FORD_ASPIRE_1996); diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 260f1a8cfc..0de4668038 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -456,7 +456,7 @@ void testRpmCalculator(void) { } void testTriggerDecoder(void) { - printf("*************************************************** testTriggerDecoder\r\n"); + printf("====================================================================================== testTriggerDecoder\r\n"); persistent_config_s c; Engine e(&c); @@ -478,6 +478,7 @@ void testTriggerDecoder(void) { testNoiselessDecoder(); + printf("====================================================================================== testTriggerDecoder part 2\r\n"); testDodgeNeonDecoder(); testTriggerDecoder2("Dodge Neon 1995", DODGE_NEON_1995, 8, 0.4931, 0.2070); @@ -494,6 +495,7 @@ void testTriggerDecoder(void) { testTriggerDecoder2("Miata NB", MAZDA_MIATA_NB1, 12, 0.0833, 0.0444); testTriggerDecoder2("Miata 2003", MAZDA_MIATA_2003, 3, 0.0444, 0.0); + printf("====================================================================================== testTriggerDecoder part 3\r\n"); testTriggerDecoder2("Civic 4/0 both", TEST_CIVIC_4_0_BOTH, 0, 0.5000, 0.0); testTriggerDecoder2("Civic 4/0 rise", TEST_CIVIC_4_0_RISE, 0, 0.5000, 0.0); diff --git a/unit_tests/test_trigger_noiseless.cpp b/unit_tests/test_trigger_noiseless.cpp index 9c46af0c0c..a213a17668 100644 --- a/unit_tests/test_trigger_noiseless.cpp +++ b/unit_tests/test_trigger_noiseless.cpp @@ -107,16 +107,16 @@ static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorTolera fireNoisyCycle60_2(ð, 2, 1000, -1, 0, 0, 0); // should be no errors anyway - assertEquals(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter); + assertEqualsM("testNoiselessDecoderProcedure totalTriggerErrorCounter", 0, engine->triggerCentral.triggerState.totalTriggerErrorCounter); // check if we're imitating the 60-2 signal correctly assertEqualsM("index #1", 0, eth.engine.triggerCentral.triggerState.getCurrentIndex()); // check rpm (60secs / (1000us * 60teeth)) = 1000rpm - assertEqualsM("RPM", 1000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); + assertEqualsM("testNoiselessDecoder RPM", 1000, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); // add noise1 - 1 spike in the middle of the 2nd rising pulse fireNoisyCycle60_2(ð, 2, 1000, 2, 10, 500, 1); - assertEqualsM("noise#1", errorToleranceCnt, engine->triggerCentral.triggerState.totalTriggerErrorCounter); + assertEqualsM("testNoiselessDecoder noise#1", errorToleranceCnt, engine->triggerCentral.triggerState.totalTriggerErrorCounter); resetTrigger(eth); @@ -158,7 +158,7 @@ static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorTolera fireNoisyCycle60_2(ð, 2, 1000, 4, 5, 10, failProofNumSpikes); // we barely survived this time - assertEqualsM("noise#6", errorToleranceCnt, engine->triggerCentral.triggerState.totalTriggerErrorCounter); + assertEqualsM("testNoiselessDecoder noise#6", errorToleranceCnt, engine->triggerCentral.triggerState.totalTriggerErrorCounter); resetTrigger(eth); @@ -168,12 +168,12 @@ static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorTolera // alas, this is a hard case even for noiseless decoder, and it fails... // but still we're close to 33% signal-noise ratio threshold - not bad! // so here's an error anyway! - assertEqualsM("noise#7_fail_test", 1, engine->triggerCentral.triggerState.totalTriggerErrorCounter); + assertEqualsM("testNoiselessDecoder noise#7_fail_test", 1, engine->triggerCentral.triggerState.totalTriggerErrorCounter); } void testNoiselessDecoder(void) { - printf("*************************************************** testNoiselessDecoder\r\n"); + printf("====================================================================================== testNoiselessDecoder\r\n"); timeNowUs = 0; schedulingQueue.clear(); @@ -191,7 +191,7 @@ void testNoiselessDecoder(void) { engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); assertEquals(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter); - assertEquals(0, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); + assertEqualsM("testNoiselessDecoder RPM", 0, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); //printTriggerDebug = true;