feat: add compression worker threads
CI / lint (pull_request) Successful in 11s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / sanitizers (undefined) (pull_request) Successful in 38s
CI / fuzz-build (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m16s
CI / valgrind (pull_request) Successful in 33s

This commit is contained in:
2026-09-03 18:15:14 +02:00
parent 190fc5d300
commit f443b2986d
16 changed files with 136 additions and 10 deletions
+17
View File
@@ -55,6 +55,22 @@ static void test_data_compress_decompress_large() {
data_destroy(decompressed);
}
static void test_data_compress_with_threads_roundtrip() {
const char original[] = "Threaded zstd compression test data";
Data* input = data_create_empty(sizeof(original) - 1);
EXPECT_NOT_NULL(input);
memcpy(input->data, original, sizeof(original) - 1);
Data* compressed = data_compress_with_threads(input, 3, 2);
EXPECT_NOT_NULL(compressed);
Data* decompressed = data_decompress(compressed);
EXPECT_NOT_NULL(decompressed);
EXPECT_EQ_INT((int)decompressed->size, (int)(sizeof(original) - 1));
EXPECT_EQ_INT(memcmp(decompressed->data, original, sizeof(original) - 1), 0);
data_destroy(input);
data_destroy(compressed);
data_destroy(decompressed);
}
static void test_chunk_compress_decompress_roundtrip() {
char* path1 = "temp_comp_test_1.txt";
char* content1 = "chunk compression test file 1";
@@ -115,5 +131,6 @@ static void test_chunk_compress_decompress_roundtrip() {
void test_compression() {
test_data_compress_decompress_roundtrip();
test_data_compress_decompress_large();
test_data_compress_with_threads_roundtrip();
test_chunk_compress_decompress_roundtrip();
}