quality: no unit tests for transport modules (TCP, SSH, TLS, Protocol) #39

Closed
opened 2026-07-20 14:58:32 +02:00 by TapTap · 1 comment
Owner

Several shared modules have no unit test coverage at all:

Module File Tests?
TCP transport transport_tcp.c None
SSH transport transport_ssh.c None
TLS transport transport_tls.c None
Protocol I/O protocol.c None
Data buffer data.c None (covered implicitly)
File operations file.c None (covered implicitly)
Metadata metadata.c None

The tests/runner.c only runs tests for: queue, array_list, shared_utils, chunk, config, compression, scanner, and delta.

This is a significant gap — the transport layer (TCP/SSH/TLS) and network protocol I/O have zero dedicated tests, making regressions in network handling difficult to catch.

Suggested Fix: Add test files:

  • tests/test_transport_tcp.c — test server_create, client_connect, basic send/receive
  • tests/test_transport_ssh.c — test parse_remote_dest
  • tests/test_transport_tls.c — test tls_global_init, SSL context creation
  • tests/test_protocol.c — test send/receive round-trips for all data types
  • tests/test_file.c — unit test file_save_to_disk, file_create, file_destroy
  • tests/test_metadata.c — test metadata_to_buf/metadata_from_buf round-trips

Severity: medium

Several shared modules have **no unit test coverage** at all: | Module | File | Tests? | |--------|------|--------| | TCP transport | `transport_tcp.c` | ❌ None | | SSH transport | `transport_ssh.c` | ❌ None | | TLS transport | `transport_tls.c` | ❌ None | | Protocol I/O | `protocol.c` | ❌ None | | Data buffer | `data.c` | ❌ None (covered implicitly) | | File operations | `file.c` | ❌ None (covered implicitly) | | Metadata | `metadata.c` | ❌ None | The `tests/runner.c` only runs tests for: queue, array_list, shared_utils, chunk, config, compression, scanner, and delta. This is a significant gap — the transport layer (TCP/SSH/TLS) and network protocol I/O have zero dedicated tests, making regressions in network handling difficult to catch. **Suggested Fix:** Add test files: - `tests/test_transport_tcp.c` — test server_create, client_connect, basic send/receive - `tests/test_transport_ssh.c` — test parse_remote_dest - `tests/test_transport_tls.c` — test tls_global_init, SSL context creation - `tests/test_protocol.c` — test send/receive round-trips for all data types - `tests/test_file.c` — unit test file_save_to_disk, file_create, file_destroy - `tests/test_metadata.c` — test metadata_to_buf/metadata_from_buf round-trips **Severity:** medium
Author
Owner

Fixed in PR #148 and earlier PRs. Unit tests for all three transport modules (TCP, SSH, TLS) exist in tests/test_transport_tcp.c, tests/test_transport_ssh.c, tests/test_transport_tls.c. Protocol tests exist in tests/test_protocol.c. All are registered in tests/runner.c.

Fixed in PR #148 and earlier PRs. Unit tests for all three transport modules (TCP, SSH, TLS) exist in tests/test_transport_tcp.c, tests/test_transport_ssh.c, tests/test_transport_tls.c. Protocol tests exist in tests/test_protocol.c. All are registered in tests/runner.c.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#39