From 261ec3c5093e89a27916210dbddc8e9e31c1d8d7 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Mon, 20 Oct 2025 04:02:34 +0900 Subject: [PATCH] scripts/check: run style check for test files Co-authored-by: @johanmalm --- scripts/check | 2 +- scripts/checkpatch.pl | 1 + t/buf-simple.c | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/check b/scripts/check index 40d48b1e..473fcfdc 100755 --- a/scripts/check +++ b/scripts/check @@ -19,7 +19,7 @@ run_checks () { return $? fi - find src/ include/ clients/ \( -name "*.c" -o -name "*.h" \) -type f -print0 | + find src/ include/ clients/ t/ \( -name "*.c" -o -name "*.h" \) -type f -print0 | nice xargs -0 --max-args 1 --max-procs $(nproc) \ scripts/checkpatch.pl --terse --no-tree --strict --file return $? diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 933dbc59..217536a6 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5661,6 +5661,7 @@ sub process { $var !~ /^(?:GString|GError|GHashTable)/ && $var !~ /^(?:__FreeBSD__)/ && $var !~ /^(?:RsvgRectangle|RsvgHandle)/ && + $var !~ /^(?:CMUnitTest)/ && $var !~ /^(?:XKB_KEY_XF86Switch_VT_1)/ && #Ignore SI style variants like nS, mV and dB diff --git a/t/buf-simple.c b/t/buf-simple.c index 72d9fd40..d3ebaeb9 100644 --- a/t/buf-simple.c +++ b/t/buf-simple.c @@ -68,7 +68,12 @@ test_buf_add_fmt(void **state) static void test_buf_add_char(void **state) { - const char long_string[] = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"; + static const char long_string[] = + "123456789012345678901234567890123456789012345678901234567890 " + "123456789012345678901234567890123456789012345678901234567890 " + "123456789012345678901234567890123456789012345678901234567890 " + "123456789012345678901234567890123456789012345678901234567890 " + "123456789012345678901234567890123456789012345678901234567890 "; size_t len = strlen(long_string); /*