Files
FastSync/tests/runner.c
TapTap e16db56580
CI / build-and-test (push) Successful in 28s
CI / build-and-test (pull_request) Successful in 28s
feat: add delta transfer for incremental sync
Implement rsync-style delta transfer using rolling checksums (Adler-32 +
xxHash32). When a file exists on both sides but has changed, only the
changed blocks are transmitted instead of the entire file.

- New status codes: STATUS_DELTA_SIGNATURE, STATUS_DELTA_DATA
- Protocol version bumped to 1.2.0
- Server generates block signature, client computes delta
- Auto-fallback to whole-file when delta >= 70% of file size
- Works with zstd compression on delta stream
- Configurable block size (default 8KB, --delta-block flag)
- 13 unit tests covering hashing, signature roundtrip, delta compute/apply,
  file growth/shrink, and decision logic
2026-07-18 20:00:15 +02:00

39 lines
951 B
C

#include "test_array_list.h"
#include "test_chunk.h"
#include "test_compression.h"
#include "test_config.h"
#include "test_delta.h"
#include "test_queue.h"
#include "test_scanner.h"
#include "test_shared_utils.h"
#include "test_utils.h"
#include <stdio.h>
// Define global test state variables
int tests_run = 0;
int tests_failed = 0;
bool current_test_failed = false;
int main() {
printf("\033[1;36m=== RUNNING UNIT TESTS ===\033[0m\n\n");
RUN_TEST(test_queue);
RUN_TEST(test_array_list);
RUN_TEST(test_shared_utils);
RUN_TEST(test_chunk);
RUN_TEST(test_config);
RUN_TEST(test_compression);
RUN_TEST(test_scanner);
RUN_TEST(test_delta);
printf("\n\033[1;36m=== TEST SUMMARY ===\033[0m\n");
printf("Total Tests Run: %d\n", tests_run);
if (tests_failed > 0) {
printf("Status: \033[1;31m%d FAILED\033[0m\n", tests_failed);
return 1;
} else {
printf("Status: \033[1;32mALL PASSED\033[0m\n");
return 0;
}
}