|
|
@ -80,7 +80,7 @@ static void test_printf(void) |
|
|
|
char buf[30]; |
|
|
|
char buf[30]; |
|
|
|
uint8_t failures = 0; |
|
|
|
uint8_t failures = 0; |
|
|
|
hal.console->printf("Running printf tests\n"); |
|
|
|
hal.console->printf("Running printf tests\n"); |
|
|
|
for (i=0; i<sizeof(float_tests)/sizeof(float_tests[0]); i++) { |
|
|
|
for (i=0; i < ARRAY_SIZE(float_tests); i++) { |
|
|
|
int ret = hal.util->snprintf(buf, sizeof(buf), float_tests[i].fmt, float_tests[i].v); |
|
|
|
int ret = hal.util->snprintf(buf, sizeof(buf), float_tests[i].fmt, float_tests[i].v); |
|
|
|
if (strcmp(buf, float_tests[i].result) != 0) { |
|
|
|
if (strcmp(buf, float_tests[i].result) != 0) { |
|
|
|
hal.console->printf("Failed float_tests[%u] '%s' -> '%s' should be '%s'\n",
|
|
|
|
hal.console->printf("Failed float_tests[%u] '%s' -> '%s' should be '%s'\n",
|
|
|
|