木头云 78be284668 fix(test): correct test logic and semantics in multiple test cases
1. ChannelTest::MultipleSendersReceivers
   - Add C++14-compatible latch implementation (similar to C++20 std::latch)
   - Ensure receivers are ready before senders start sending messages
   - This prevents race condition where senders might send before receivers are listening

2. RWLockTest::ReadWriteReadPattern
   - Fix test logic: lock_shared allows multiple concurrent readers
   - Previous test had race condition where both threads could read same value
   - New test: each thread writes based on thread id (1 or 2), then reads
   - Expected result: 1*20 + 2*20 = 60

3. ShmTest::ReleaseMemory
   - Correct return value semantics: release() returns ref count before decrement, or -1 on error
   - Must call get_mem() to map memory and set ref count to 1 before release
   - Expected: release() returns 1 (ref count before decrement)

4. ShmTest::ReferenceCount
   - Correct semantics: ref count is 0 after acquire (memory not mapped)
   - get_mem() maps memory and sets ref count to 1
   - Second acquire+get_mem increases ref count to 2
   - Test now properly validates reference counting behavior

5. ShmTest::SubtractReference
   - sub_ref() only works after get_mem() has mapped the memory
   - Must call get_mem() first to initialize ref count to 1
   - sub_ref() then decrements it to 0
   - Test now follows correct API usage pattern
2025-11-30 06:06:54 +00:00
..
archive chore(test): archive existing test cases to test/archive 2025-11-30 04:04:10 +00:00
CMakeLists.txt build(test): update CMakeLists.txt for new test structure 2025-11-30 04:16:41 +00:00
test_buffer.cpp refactor(buffer): rename 'additional' parameter to 'mem_to_free' for clarity 2025-11-30 05:09:56 +00:00
test_condition.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_ipc_channel.cpp fix(test): correct test logic and semantics in multiple test cases 2025-11-30 06:06:54 +00:00
test_locks.cpp fix(test): correct test logic and semantics in multiple test cases 2025-11-30 06:06:54 +00:00
test_mutex.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_semaphore.cpp style(test): change indentation from 4 spaces to 2 spaces 2025-11-30 04:22:24 +00:00
test_shm.cpp fix(test): correct test logic and semantics in multiple test cases 2025-11-30 06:06:54 +00:00