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

   ## Summary
   
   mktemp(), mkstemp() and mkdtemp() must return an error at once when stat() 
fails with an error other than ENOENT, because that error is the same for every 
name they try. Before apache/nuttx#21563 they tried up to `UINT32_MAX` names 
and did not return.
   
   This PR adds testing/libc/mktemp (`CONFIG_TESTING_MKTEMP`, program 
`mktemp_test`). It gives the three functions a name longer than `NAME_MAX` and 
expects an error with ENAMETOOLONG. The calls run in a thread: if they do not 
return in 10 seconds, the test prints an error and ends with a failure, so a 
broken libc does not stop a test run.
   
   depends-on: apache/nuttx/pull/21563
   
   ## Impact
   
   New test program only, off by default. Make and CMake build files are both 
added.
   
   ## Testing
   
   - qemu-armv8a:nsh (flat build, arm64, QEMU) with `CONFIG_TESTING_MKTEMP` and 
apache/nuttx#21563: `mktemp: OK`, `mkstemp: OK`, `mkdtemp: OK`, 0 errors. 
ostest exits 0 after it.
   - The same on nuttx master: `ERROR: the calls did not return in 10 seconds`, 
the test ends with a failure, and ostest after it still exits 0.
   
   `tools/checkpatch.sh -c -u -m -g origin/master..HEAD` 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