test: fix cppcheck style findings in cycle-F tests
CI / lint (pull_request) Successful in 1m53s
CI / parity-full (pull_request) Skipped
CI / sanitizers (address) (pull_request) Skipped
CI / sanitizers (undefined) (pull_request) Skipped
CI / fuzz-build (pull_request) Skipped
CI / coverage (pull_request) Skipped
CI / valgrind (pull_request) Skipped
CI / parity-fast (pull_request) Successful in 17s
CI / build-and-test (pull_request) Successful in 54s

This commit is contained in:
2026-09-24 01:38:56 +02:00
parent 90f2fb613f
commit 7408686370
30 changed files with 42 additions and 2 deletions
+1
View File
@@ -0,0 +1 @@
top
Symlink
+1
View File
@@ -0,0 +1 @@
b.txt
+1
View File
@@ -0,0 +1 @@
nested
+1
View File
@@ -0,0 +1 @@
top
Symlink
+1
View File
@@ -0,0 +1 @@
b.txt
+1
View File
@@ -0,0 +1 @@
nested
+1 -1
View File
@@ -424,7 +424,7 @@ static int file_spool_create(const char* dest_path, char** out_spool_path) {
continue;
}
char* copy = str_dup(dest_path);
char* dir = copy ? dirname(copy) : NULL;
const char* dir = copy ? dirname(copy) : NULL;
size_t need = dir ? strlen(dir) + 1 + strlen(name) + 1 : 0;
char* full = need ? malloc(need) : NULL;
if (!full) {
@@ -0,0 +1 @@
hello
@@ -0,0 +1 @@
x
@@ -0,0 +1 @@
y
+1
View File
@@ -0,0 +1 @@
a.txt
+1
View File
@@ -0,0 +1 @@
b.txt
@@ -0,0 +1 @@
world
@@ -0,0 +1 @@
deep
+1
View File
@@ -0,0 +1 @@
../a.txt
+1
View File
@@ -0,0 +1 @@
hello
+1
View File
@@ -0,0 +1 @@
b.txt
+1
View File
@@ -0,0 +1 @@
world
+1
View File
@@ -0,0 +1 @@
deep
+1
View File
@@ -0,0 +1 @@
../a.txt
@@ -0,0 +1 @@
hello
@@ -0,0 +1 @@
world
+1
View File
@@ -0,0 +1 @@
hello
+1
View File
@@ -0,0 +1 @@
world
@@ -0,0 +1 @@
hello
@@ -0,0 +1 @@
world
+1
View File
@@ -0,0 +1 @@
hello
+1
View File
@@ -0,0 +1 @@
world
+1
View File
@@ -292,6 +292,7 @@ static void test_delay_updates_unique_staging_name() {
DelayUpdatesContext* second = delay_updates_context_create("test_delay_uniq_tmp");
EXPECT_NOT_NULL(first);
EXPECT_NOT_NULL(second);
/* cppcheck-suppress knownConditionTrueFalse -- the EXPECT_NOT_NULL checks above return on NULL */
if (first && second) {
EXPECT_EQ_INT(strncmp(first->staging_name, ".fastsync-stage.", 16), 0);
EXPECT_EQ_INT(strncmp(second->staging_name, ".fastsync-stage.", 16), 0);
+13 -1
View File
@@ -2498,9 +2498,13 @@ static void test_file_receive_payload_streams(void) {
EXPECT_NULL(buffer);
EXPECT_NOT_NULL(spool);
EXPECT_TRUE(out_size == size);
/* cppcheck-suppress knownConditionTrueFalse -- EXPECT_NOT_NULL/EXPECT_TRUE above returns on
* failure */
if (spool) {
FILE* fh = fopen(spool, "rb");
EXPECT_NOT_NULL(fh);
/* cppcheck-suppress knownConditionTrueFalse -- EXPECT_NOT_NULL/EXPECT_TRUE above returns on
* failure */
if (fh) {
unsigned char* got = malloc(size);
EXPECT_TRUE(fread(got, 1, size, fh) == size);
@@ -2525,6 +2529,8 @@ static void test_file_receive_payload_streams(void) {
Data* compressed = data_compress_codec(raw, COMPRESSION_ALGO_ZSTD, 3, 0);
data_destroy(raw);
EXPECT_NOT_NULL(compressed);
/* cppcheck-suppress knownConditionTrueFalse -- EXPECT_NOT_NULL/EXPECT_TRUE above returns on
* failure */
if (compressed) {
int p[2];
EXPECT_EQ_INT(pipe(p), 0);
@@ -2537,9 +2543,13 @@ static void test_file_receive_payload_streams(void) {
EXPECT_NULL(buffer);
EXPECT_NOT_NULL(spool);
EXPECT_TRUE(out_size == size);
/* cppcheck-suppress knownConditionTrueFalse -- EXPECT_NOT_NULL/EXPECT_TRUE above returns on
* failure */
if (spool) {
FILE* fh = fopen(spool, "rb");
EXPECT_NOT_NULL(fh);
/* cppcheck-suppress knownConditionTrueFalse -- EXPECT_NOT_NULL/EXPECT_TRUE above returns on
* failure */
if (fh) {
unsigned char* got = malloc(size);
EXPECT_TRUE(fread(got, 1, size, fh) == size);
@@ -2575,9 +2585,11 @@ static void test_delta_stream_helpers(void) {
DeltaSignature* mem_sig = delta_signature_create_seeded(basis, sizeof(basis), 4, 0);
EXPECT_NOT_NULL(fd_sig);
EXPECT_NOT_NULL(mem_sig);
/* cppcheck-suppress knownConditionTrueFalse -- EXPECT_NOT_NULL/EXPECT_TRUE above returns on
* failure */
if (fd_sig && mem_sig) {
EXPECT_TRUE(fd_sig->block_count == mem_sig->block_count);
for (uint32_t i = 0; i < fd_sig->block_count && i < mem_sig->block_count; i++) {
for (uint32_t i = 0; i < fd_sig->block_count; i++) {
EXPECT_TRUE(fd_sig->blocks[i].adler32 == mem_sig->blocks[i].adler32);
EXPECT_TRUE(fd_sig->blocks[i].xxhash == mem_sig->blocks[i].xxhash);
}