efiPrint NaN handling #4115
This commit is contained in:
parent
81a73508b7
commit
097bfb6e9c
|
@ -37,6 +37,7 @@ int getRemainingStack(thread_t*) {
|
|||
|
||||
static void assertString(const char*actual, const char *expected) {
|
||||
if (strcmp(actual, expected) != 0) {
|
||||
printf("assertString FAILED\n");
|
||||
firmwareError(OBD_PCM_Processor_Fault, "chprintf test: got %s while %s", actual, expected);
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +48,11 @@ static void runChprintfTest() {
|
|||
msObjectInit(&ts, (uint8_t *) testBuffer, sizeof(testBuffer), 0);
|
||||
|
||||
|
||||
ts.eos = 0; // reset
|
||||
// chprintf((BaseSequentialStream*)&ts, "%.2f - %.2f", NAN, 0/0);
|
||||
// ts.buffer[ts.eos] = 0;
|
||||
// assertString(testBuffer, "0.23/239.9320/0.1234");
|
||||
|
||||
// it's a very, very long and mostly forgotten story how this became our %.2f precision format
|
||||
ts.eos = 0; // reset
|
||||
chprintf((BaseSequentialStream*)&ts, "%.2f/%.4f/%.4f", 0.239f, 239.932, 0.1234);
|
||||
|
|
Loading…
Reference in New Issue