fix: validate delta output and integration test skips
CI / lint (pull_request) Successful in 24s
CI / sanitizers (address) (pull_request) Successful in 37s
CI / sanitizers (undefined) (pull_request) Successful in 36s
CI / fuzz-build (pull_request) Successful in 13s
CI / coverage (pull_request) Successful in 30s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s

This commit is contained in:
2026-08-08 20:08:30 +02:00
parent d529360c01
commit 4feb75957a
4 changed files with 43 additions and 6 deletions
+17
View File
@@ -323,6 +323,22 @@ static void test_large_file_delta() {
free(new_data);
}
static void test_delta_apply_rejects_output_overflow() {
uint8_t old_data[8] = {0};
uint8_t literal_data[2] = {'x', 'y'};
DeltaInstruction instruction = {
.type = DELTA_INSTR_LITERAL,
.literal = {.data = literal_data, .length = sizeof(literal_data)},
};
Delta delta = {
.new_file_size = 1,
.instruction_count = 1,
.instructions = &instruction,
};
EXPECT_TRUE(delta_apply(old_data, sizeof(old_data), &delta, 1) == NULL);
}
void test_delta() {
test_adler32_basic();
test_adler32_different_data();
@@ -338,4 +354,5 @@ void test_delta() {
test_should_attempt();
test_is_worthwhile();
test_large_file_delta();
test_delta_apply_rejects_output_overflow();
}