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

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   IOB test cases and a kasantest build fix from Xiaomi Vela.
   
   - **testing/mm/iob: add iob test for various iob api**: besides the 
throttled/unthrottled copy test, cases for allocation and free, copy in and 
out, queue operations, chains, clone, pack and contig, packet length update, 
queue concatenation, tailroom, and the chain-end flag that a queue keeps in the 
low bits of `io_flink`.
   - **tesitng/mm/iob: fix compile break**: `iob_add_queue()` and 
`iob_concat_queue()` cannot fail (the queue allocates nothing, both return 0), 
so the test no longer checks their return value; the error paths free the queue 
they filled.
   - **testing/mm/iob: add regression test for extended tail chain**: a chain 
extended with `iob_copyin()` after it was enqueued, then another chain enqueued 
behind it; covers 69c67a58493.
   - **testing/mm/kasantest: guard GCC-only warning flags**: 
`-Wno-use-after-free` and `-Wno-stringop-overflow` are passed only with a GCC 
toolchain, clang warns about these unknown `-Wno-` options. The other half of 
the original change, printing `tv_sec` as `intmax_t`, is in master already 
(f9f59bd0f8); the `-fno-builtin` of master stays.
   
   One follow-up commit, right after the commit it fixes: **testing/mm/iob: fix 
the nxstyle and codespell errors**, one-line `if` statements and a comment that 
codespell reads as a misspelling.
   
   ## Impact
   
   - Test code only: `testing/mm/iob` and the build flags of 
`testing/mm/kasantest`.
   - "Test 10: IOB Pointer Low-Bit Flags" builds four chains of 3, 2, 3 and 1 
IOBs, so the iob test needs `CONFIG_IOB_NBUFFERS` >= 9. With fewer IOBs 
(`sim:nsh` has 8) that case fails to allocate its last chain and the test stops 
there. `sim:citest` has 128.
   - GCC builds of kasantest keep the same flags.
   
   ## Testing
   
   Host: Ubuntu 22.04 x86_64, GCC 13.4.0 (sim), CMake 3.23 + Ninja 1.10. Base: 
nuttx-apps master 9cd18a2d63d, nuttx master f284e6d7a75.
   
   `./tools/checkpatch.sh -c -u -m -g HEAD~5..HEAD` passes.
   
   Every commit builds without warnings (CMake, incremental) for `sim:nsh` with 
`MM_IOB`, `TESTING_IOB`, `IOB_NBUFFERS=64`, `MM_KASAN` and `TESTING_KASAN`; the 
head also builds with Make. kasantest.c is compiled with `-fno-builtin 
-Wno-error -Wno-array-bounds -Wno-unused-value -Wno-unused-variable 
-Wno-free-nonheap-object -O0 -Wno-use-after-free -Wno-stringop-overflow`, the 
flags of master.
   
   `sim:nsh` as above, `iob`:
   
   ```
   Test 1 PASSED
   ...
   Test 10 PASSED
   Original IOB Test PASSED
   === Test 12: IOB Queue Extend Enqueued Tail Chain ===
   Test 12 PASSED
   ==================================================
   ALL IOB TESTS PASSED!
   ==================================================
   ```
   
   With the 8 IOBs of `sim:nsh` the run stops at Test 10 (`ERROR: Failed to 
allocate first IOB in chain`), see Impact.
   
   Not tested: a clang build (no clang toolchain on this host), real 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]

Reply via email to