quality: no unit tests for transport modules (TCP, SSH, TLS, Protocol) #39
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Several shared modules have no unit test coverage at all:
transport_tcp.ctransport_ssh.ctransport_tls.cprotocol.cdata.cfile.cmetadata.cThe
tests/runner.conly 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/receivetests/test_transport_ssh.c— test parse_remote_desttests/test_transport_tls.c— test tls_global_init, SSL context creationtests/test_protocol.c— test send/receive round-trips for all data typestests/test_file.c— unit test file_save_to_disk, file_create, file_destroytests/test_metadata.c— test metadata_to_buf/metadata_from_buf round-tripsSeverity: medium
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.