casaroli opened a new pull request, #3978:
URL: https://github.com/apache/nuttx-apps/pull/3978

   depends-on: apache/nuttx/pull/21474
   
   ## Summary
   
   A test of `printf()` for apache/nuttx#21474. Part of apache/nuttx#21467.
   
   `printf_test()` runs with the libc tests of ostest. It checks that:
   
   - `%a`, `%L` and `%n` take each argument at its right size
   - an unknown conversion takes no argument and ends the conversions
   - `printf()` reads no further than the end of the format
   - a width above 255 gives the right length
   - output above `INT_MAX` fails with `EOVERFLOW`
   - numbered arguments stay in order
   
   The test adapts to `CONFIG_LIBC_FLOATINGPOINT` and 
`CONFIG_LIBC_NUMBERED_ARGS`. An error prints the format and stops with an 
assertion.
   
   ## Impact
   
   A new file in ostest and the option `CONFIG_TESTING_OSTEST_PRINTF`. It is on 
unless `DEFAULT_SMALL` is set, so small boards do not grow. No change to any 
other code.
   
   This test fails on NuttX master until apache/nuttx#21474 merges, so this PR 
must merge after it.
   
   ## Testing
   
   ostest with Make, NuttX flat builds under QEMU:
   
   | Config | NuttX | Result |
   |---|---|---|
   | `rv-virt:nsh`, float off | master 6e1126a2362 | fails, status 256 |
   | `rv-virt:nsh`, float off | #21474 | status 0 |
   | `rv-virt:nsh`, float and numbered arguments on | #21474 | status 0 |
   | `qemu-armv8a:nsh`, float and numbered arguments on | #21474 | status 0 |
   
   The failure on master:
   
   ```
   printf_test: ERROR: "%a|%s" returned 9: "%a|(null)", expected "?|str"
   ```
   
   These runs used 8f7644552bf of #21474. Its last revision, f4044a05e50, only 
removes casts, and these runs were not repeated on it.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
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]

Reply via email to