refactoring
This commit is contained in:
parent
e6d368d6f7
commit
f801345ec7
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "unit_test_framework.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "error_handling.h"
|
||||
|
@ -43,18 +44,6 @@ void print(const char *fmt, ...);
|
|||
|
||||
#define chDbgCheck(x, y) chDbgAssert(x, y, NULL)
|
||||
|
||||
void assertEqualsM2(const char *msg, float expected, float actual, float EPS);
|
||||
void assertEqualsM(const char *msg, float expected, float actual);
|
||||
void assertEqualsLM(const char *msg, long expected, long actual);
|
||||
void assertEqualsM4(const char *prefix, const char *msg, float expected, float actual);
|
||||
void assertEqualsM5(const char *prefix, const char *message, float expected, float actual, float EPS);
|
||||
void assertEquals(float expected, float actual);
|
||||
void assertTrue(float actual);
|
||||
void assertTrueM(const char *msg, float actual);
|
||||
void assertFalse(float actual);
|
||||
void assertFalseM(const char *msg, float actual);
|
||||
|
||||
|
||||
#define systicks2ms(x) (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -291,11 +291,6 @@ static void assertREqualsM(const char *msg, void *expected, void *actual) {
|
|||
extern bool_t debugSignalExecutor;
|
||||
extern EnginePins enginePins;
|
||||
|
||||
// todo: move method body here after merge
|
||||
void assertEvent(const char *msg, int index, void *callback, efitime_t start, efitime_t momentX, long param);
|
||||
void assertInjectorUpEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex);
|
||||
void assertInjectorDownEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex);
|
||||
|
||||
void testRpmCalculator(void) {
|
||||
printf("*************************************************** testRpmCalculator\r\n");
|
||||
timeNowUs = 0;
|
||||
|
@ -592,7 +587,7 @@ extern fuel_Map3D_t fuelMap;
|
|||
void assertEvent(const char *msg, int index, void *callback, efitime_t start, efitime_t momentX, long param) {
|
||||
assertTrueM(msg, schedulingQueue.size() > index);
|
||||
scheduling_s *ev = schedulingQueue.getForUnitText(index);
|
||||
assertEqualsM4(msg, "up/down", (void*)ev->callback == (void*) callback, 1);
|
||||
assertEqualsM4(msg, " up/down", (void*)ev->callback == (void*) callback, 1);
|
||||
assertEqualsM(msg, momentX, ev->momentX - start);
|
||||
InjectionSignalPair *pair = (InjectionSignalPair *)ev->param;
|
||||
assertEqualsLM(msg, param, (long)pair->outputs[0]);
|
||||
|
|
|
@ -8,8 +8,21 @@
|
|||
#ifndef UNIT_TEST_FRAMEWORK_H_
|
||||
#define UNIT_TEST_FRAMEWORK_H_
|
||||
|
||||
#include "efitime.h"
|
||||
|
||||
void assertEqualsM2(const char *msg, float expected, float actual, float EPS);
|
||||
void assertEqualsM(const char *msg, float expected, float actual);
|
||||
void assertEqualsLM(const char *msg, long expected, long actual);
|
||||
void assertEqualsM4(const char *prefix, const char *msg, float expected, float actual);
|
||||
void assertEqualsM5(const char *prefix, const char *message, float expected, float actual, float EPS);
|
||||
void assertEquals(float expected, float actual);
|
||||
void assertTrue(float actual);
|
||||
void assertTrueM(const char *msg, float actual);
|
||||
void assertFalse(float actual);
|
||||
void assertFalseM(const char *msg, float actual);
|
||||
|
||||
|
||||
void assertEvent(const char *msg, int index, void *callback, efitime_t start, efitime_t momentX, long param);
|
||||
void assertInjectorUpEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex);
|
||||
void assertInjectorDownEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex);
|
||||
|
||||
#endif /* UNIT_TEST_FRAMEWORK_H_ */
|
||||
|
|
Loading…
Reference in New Issue