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

   depends-on: apache/nuttx/pull/21648
   
   ## Summary
   
   This PR adds testing/libc/lsearch (`CONFIG_TESTING_LSEARCH`, program 
`lsearch_test`), a test of `lfind()`, `lsearch()`, `insque()` and `remque()` of 
`<search.h>`.
   
   - `lfind()`: the first match, a missing key, an empty table, and the key as 
the first argument of the comparison function.
   - `lsearch()`: a present key adds nothing; a missing key is added at the end 
with all of its bytes, and is then found; a key is added to an empty table.
   - `insque()` and `remque()` on a linear queue (`insque()` with no 
predecessor, after the last element and between two elements; `remque()` of a 
middle, the last and the first element) and on a circular queue.
   
   The test prints one line for each check and returns `EXIT_FAILURE` if a 
check fails.
   
   ## Impact
   
   New test program only, off by default. Make and CMake build files are both 
added.
   
   ## Testing
   
   With apache/nuttx#21648, `lsearch_test`: 0 errors, and ostest after it exits 
with status 0:
   
   - `qemu-armv8a:knsh` (kernel build, arm64, QEMU with HVF).
   - `qemu-armv8a:nsh` (flat build, arm64, QEMU with HVF).
   - `mps2-an500:knsh` (protected build, armv7-m, QEMU), built with 
`EXTRAFLAGS=-Werror`.
   - `qemu-armv8a:nsh` built with CMake (test only).
   
   On nuttx master the test does not compile: implicit declaration of `lfind`, 
`lsearch`, `insque` and `remque`.
   
   On a Linux host the test gives the same results with glibc 2.43 and with the 
musl sources: 0 errors.
   
   `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