casaroli opened a new pull request, #3994: URL: https://github.com/apache/nuttx-apps/pull/3994
## Summary A test for apache/nuttx#21505. Part of apache/nuttx#21467. `printftest` expected the output of the Default profile, so it failed with the other profiles of libc and when one printf option was turned off. Each case now follows the options of `printf()`: - `LIBC_FLOATINGPOINT`, `LIBC_NUMBERED_ARGS`, `LIBC_PRINTF_ALT_FORM` and `LIBC_PRINTF_INT_PRECISION` - `LIBC_PRINTF_OCTAL` (`%o` prints "?") and `LIBC_PRINTF_LEFT_JUSTIFY` (the `-` flag pads on the left) - `LIBC_PRINTF_HEXFLOAT`, `LIBC_PRINTF_C23` and `LIBC_PRINTF_PERCENT_N` `LIBC_PRINTF_SHORT` and `LIBC_PRINTF_LONG_LONG` change no case: `%hhn` and `%lln` store at their size with both settings. New cases: the sign of -0.0, `%a` and `%A`, `%b` and `%B`, and the `wN` length. ## Impact One file: `testing/libc/printftest/printftest_main.c`. No new option. No change to any other code. ## Testing `qemu-armv8a:knsh` (kernel build, arm64, HVF), nuttx master 6d1fa235d69 (with apache/nuttx#21505), `CONFIG_TESTING_PRINTFTEST`, then ostest: | printf settings | result | |---|---| | Default | PASS | | Full | PASS | | Minimal | PASS | | Default, `LIBC_PRINTF_OCTAL=n`, `LIBC_PRINTF_LEFT_JUSTIFY=n` | PASS | | Minimal, `LIBC_PRINTF_OCTAL=n`, `LIBC_PRINTF_LEFT_JUSTIFY=n` | PASS | | Full, `LIBC_PRINTF_PERCENT_N=y`, `LIBC_PRINTF_OCTAL=n`, `LIBC_PRINTF_LEFT_JUSTIFY=n`, `LIBC_PRINTF_SHORT=n`, `LIBC_PRINTF_LONG_LONG=n` | PASS | The test before this PR fails with Default, `LIBC_PRINTF_OCTAL=n`, `LIBC_PRINTF_LEFT_JUSTIFY=n`: `"%5a|%-5A|%s" returned 15: " ?| ?|str", expected " ?|? |str"`. ostest exits 0 in each run. `tools/checkpatch.sh -c -u -m -g` passes. Not run: a CMake build, a protected build, hardware. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
