auto-sync
This commit is contained in:
parent
8d41bd8c93
commit
83e99bff75
|
@ -53,7 +53,10 @@ efitick_t getTimeNowNt(void) {
|
||||||
return getTimeNowUs() * US_TO_NT_MULTIPLIER;
|
return getTimeNowUs() * US_TO_NT_MULTIPLIER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void assertEqualsM2(const char *msg, float expected, float actual, float EPS) {
|
void assertEqualsM3(const char *prefix, const char *message, float expected, float actual, float EPS) {
|
||||||
|
char msg[100];
|
||||||
|
strcpy(msg, prefix);
|
||||||
|
strcat(msg, message);
|
||||||
if (cisnan(actual) && !cisnan(expected)) {
|
if (cisnan(actual) && !cisnan(expected)) {
|
||||||
printf("Assert failed: %s %.4f while expected %.4f\r\n", msg, actual, expected);
|
printf("Assert failed: %s %.4f while expected %.4f\r\n", msg, actual, expected);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
@ -68,6 +71,14 @@ void assertEqualsM2(const char *msg, float expected, float actual, float EPS) {
|
||||||
printf("Validated %s: %f\r\n", msg, expected);
|
printf("Validated %s: %f\r\n", msg, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void assertEqualsM2(const char *msg, float expected, float actual, float eps) {
|
||||||
|
assertEqualsM3("", msg, expected, actual, eps);
|
||||||
|
}
|
||||||
|
|
||||||
|
void assertEqualsM4(const char *prefix, const char *msg, float expected, float actual) {
|
||||||
|
assertEqualsM3(prefix, msg, expected, actual, 0.00001);
|
||||||
|
}
|
||||||
|
|
||||||
void assertEqualsLM(const char *msg, long expected, long actual) {
|
void assertEqualsLM(const char *msg, long expected, long actual) {
|
||||||
if (expected != actual) {
|
if (expected != actual) {
|
||||||
printf("Assert failed: %s %d while expected %d\r\n", msg, actual, expected);
|
printf("Assert failed: %s %d while expected %d\r\n", msg, actual, expected);
|
||||||
|
|
|
@ -45,6 +45,7 @@ void print(const char *fmt, ...);
|
||||||
void assertEqualsM2(const char *msg, float expected, float actual, float EPS);
|
void assertEqualsM2(const char *msg, float expected, float actual, float EPS);
|
||||||
void assertEqualsM(const char *msg, float expected, float actual);
|
void assertEqualsM(const char *msg, float expected, float actual);
|
||||||
void assertEqualsLM(const char *msg, long expected, long actual);
|
void assertEqualsLM(const char *msg, long expected, long actual);
|
||||||
|
void assertEqualsM4(const char *prefix, const char *msg, float expected, float actual);
|
||||||
void assertEquals(float expected, float actual);
|
void assertEquals(float expected, float actual);
|
||||||
void assertTrue(float actual);
|
void assertTrue(float actual);
|
||||||
void assertTrueM(const char *msg, float actual);
|
void assertTrueM(const char *msg, float actual);
|
||||||
|
|
Loading…
Reference in New Issue