No dedicated unit tests for multiprocessing module #63

Closed
opened 2026-07-20 17:14:08 +02:00 by TapTap · 0 comments
Owner

Description

The src/shared/multiprocessing.c module contains the pipeline context management for both sender and receiver sides, including the receive_thread() and write_thread() functions. However, there are no dedicated unit tests for:

  1. pipeline_context_sender_create() / pipeline_context_sender_destroy() — (partially tested in test_config via pipeline context lifecycle tests)
  2. pipeline_context_receiver_create() / pipeline_context_receiver_destroy()
  3. receive_thread() — the actual receive logic
  4. write_thread() — the actual write logic

The lifecycle tests in test_config.c test creation/destruction but not the actual threading behavior.

Location

src/shared/multiprocessing.c, tests/test_config.c:60-89

Suggested Fix

Add tests that:

  1. Exercise receive_thread() with controlled input (simulated protocol messages over a pipe)
  2. Exercise write_thread() with a file queue and verify files are written to disk
  3. Test the full sender-side pipeline with mocked file descriptors

Severity

Low

Category

Quality

## Description The `src/shared/multiprocessing.c` module contains the pipeline context management for both sender and receiver sides, including the `receive_thread()` and `write_thread()` functions. However, there are no dedicated unit tests for: 1. `pipeline_context_sender_create()` / `pipeline_context_sender_destroy()` — (partially tested in test_config via pipeline context lifecycle tests) 2. `pipeline_context_receiver_create()` / `pipeline_context_receiver_destroy()` 3. `receive_thread()` — the actual receive logic 4. `write_thread()` — the actual write logic The lifecycle tests in `test_config.c` test creation/destruction but not the actual threading behavior. ## Location `src/shared/multiprocessing.c`, `tests/test_config.c:60-89` ## Suggested Fix Add tests that: 1. Exercise `receive_thread()` with controlled input (simulated protocol messages over a pipe) 2. Exercise `write_thread()` with a file queue and verify files are written to disk 3. Test the full sender-side pipeline with mocked file descriptors ## Severity Low ## Category Quality
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#63