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

   use cmocka framework to write unit tests for rwsem api
   
   ## Summary
   
   Add unit tests for rwsemaphore API using cmocka framework to improve code 
coverage and ensure correctness of reader-writer semaphore functionality. The 
tests verify basic synchronization primitives including initialization, lock 
acquisition (blocking/non-blocking), and lock release for both readers and 
writers.
   
   ## Impact
   
   Build: Minimal impact, only adds new test files
   Testing: Adds new test case rwsemtest for schedtest (enabled with 
CONFIG_TESTING_SCHEDTEST=y)
   Compatibility: No breaking changes, purely additive
   
   ## Testing
   
   Test Scenarios
   Single Writer: Writer thread acquires write lock, updates shared resource (0 
→ 10), verifies exclusive access
   Multiple Readers: Three reader threads with different behaviors:
   Reader 1: Basic read lock/unlock with data verification
   Reader 2: Tests down_read_trylock() non-blocking behavior
   Reader 3: Tests recursive read lock acquisition (same thread acquires twice)
   Reader-Writer Exclusion: Verifies readers are blocked while writer holds the 
lock  
   
   Tested on QEMU simultiaon  
   Config:CONFIG_TESTING_SCHEDTEST=y
   


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