nicer test messages
This commit is contained in:
parent
7069d83e2d
commit
4f416453b1
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue