fix: address PR review — fuzz target fixes, UBSan, CI improvements
CI / lint (push) Successful in 9s
CI / lint (pull_request) Successful in 8s
CI / build-and-test (push) Successful in 54s
CI / sanitizers (address) (push) Successful in 14s
CI / sanitizers (undefined) (push) Successful in 15s
CI / fuzz-build (push) Successful in 53s
CI / coverage (push) Successful in 22s
CI / valgrind (push) Successful in 26s
CI / build-and-test (pull_request) Successful in 53s
CI / sanitizers (address) (pull_request) Successful in 14s
CI / sanitizers (undefined) (pull_request) Successful in 14s
CI / fuzz-build (pull_request) Successful in 37s
CI / valgrind (pull_request) Successful in 27s
CI / coverage (pull_request) Successful in 1m36s
CI / lint (push) Successful in 9s
CI / lint (pull_request) Successful in 8s
CI / build-and-test (push) Successful in 54s
CI / sanitizers (address) (push) Successful in 14s
CI / sanitizers (undefined) (push) Successful in 15s
CI / fuzz-build (push) Successful in 53s
CI / coverage (push) Successful in 22s
CI / valgrind (push) Successful in 26s
CI / build-and-test (pull_request) Successful in 53s
CI / sanitizers (address) (pull_request) Successful in 14s
CI / sanitizers (undefined) (pull_request) Successful in 14s
CI / fuzz-build (pull_request) Successful in 37s
CI / valgrind (pull_request) Successful in 27s
CI / coverage (pull_request) Successful in 1m36s
Critical fixes: - Add missing #include <string.h> to 5 fuzz targets (wouldn't compile with GCC14+/Clang16+) - Fix fuzz_metadata_from_buf.c OOB read: guard size >= sizeof(int) + FILE_METADATA_WIRE_SIZE - Add Clang compiler check for ENABLE_FUZZ in CMakeLists.txt (fail fast at configure time) - Add fuzz-build CI job (install clang, build all 6 fuzz targets with ENABLE_FUZZ=ON) Warning fixes: - Add UBSan to sanitizer CI matrix (address + undefined) - Remove tautological test_property_glob_consistency (pure/deterministic function) - Use fixed seed srand(42) instead of srand(time(NULL)) for reproducible property tests - Add valid-header + truncated-instructions delta robustness test (exercises instruction-loop error paths) - Fix lcov --remove to exclude '*/_deps/*' (xxhash coverage pollution) - Add comment explaining FASTSYNC_UNDER_VALGRIND skip in test_file.c - Update .gitignore for build-*/ directories
This commit is contained in:
+1
-18
@@ -10,7 +10,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
static Data* random_data(int min_size, int max_size) {
|
||||
int size = min_size + rand() % (max_size - min_size + 1);
|
||||
@@ -21,7 +20,7 @@ static Data* random_data(int min_size, int max_size) {
|
||||
}
|
||||
|
||||
static void test_property_compress_roundtrip() {
|
||||
srand((unsigned)time(NULL));
|
||||
srand(42);
|
||||
for (int iter = 0; iter < 10; iter++) {
|
||||
Data* original = random_data(1, 10000);
|
||||
EXPECT_NOT_NULL(original);
|
||||
@@ -114,24 +113,8 @@ static void test_property_chunk_roundtrip() {
|
||||
}
|
||||
}
|
||||
|
||||
static void test_property_glob_consistency() {
|
||||
const char* patterns[] = {"*.txt", "test_*", "*.c", "foo", "*.??", "a*b*c"};
|
||||
const char* strings[] = {"test.txt", "foo.c", "bar", "abc", "aXbYcZ", ""};
|
||||
int n_patterns = sizeof(patterns) / sizeof(patterns[0]);
|
||||
int n_strings = sizeof(strings) / sizeof(strings[0]);
|
||||
|
||||
for (int p = 0; p < n_patterns; p++) {
|
||||
for (int s = 0; s < n_strings; s++) {
|
||||
bool first = glob_match(patterns[p], strings[s]);
|
||||
bool second = glob_match(patterns[p], strings[s]);
|
||||
EXPECT_TRUE(first == second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void test_property() {
|
||||
test_property_compress_roundtrip();
|
||||
test_property_delta_roundtrip();
|
||||
test_property_chunk_roundtrip();
|
||||
test_property_glob_consistency();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user