From 33e416324f0621a849fb13bb8d49132907b185cd Mon Sep 17 00:00:00 2001 From: TapTap Date: Sat, 8 Aug 2026 20:43:53 +0200 Subject: [PATCH] test: annotate intentional static-analysis guards --- tests/test_file.c | 1 + tests/test_multiprocessing.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/test_file.c b/tests/test_file.c index 11e0780..d867b4f 100644 --- a/tests/test_file.c +++ b/tests/test_file.c @@ -138,6 +138,7 @@ static void test_to_disk_does_not_follow_symlink() { FILE* fp = fopen(outside, "rb"); char buf[16] = {0}; EXPECT_NOT_NULL(fp); + // cppcheck-suppress knownConditionTrueFalse if (!fp) return; size_t read_count = fread(buf, 1, sizeof(buf) - 1, fp); diff --git a/tests/test_multiprocessing.c b/tests/test_multiprocessing.c index 253ef06..fdb38ba 100644 --- a/tests/test_multiprocessing.c +++ b/tests/test_multiprocessing.c @@ -91,7 +91,9 @@ static void test_sender_zero_capacity() { cfg->send_directory = str_dup("/src"); cfg->receive_root_directory = str_dup("/dst"); + // cppcheck-suppress constVariablePointer Queue* const q1 = queue_create(0, NULL); + // cppcheck-suppress constVariablePointer Queue* const q2 = queue_create(0, NULL); EXPECT_NULL(q1); EXPECT_NULL(q2);