From 37ca9bc5f8e9a3a8dc06ed7c4ea8e1ad8232f445 Mon Sep 17 00:00:00 2001 From: tyfkda Date: Mon, 22 Apr 2024 14:59:28 +0900 Subject: [PATCH] Make test table as static const --- libsrc/tests/xtest.h | 2 +- tests/xtest.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/tests/xtest.h b/libsrc/tests/xtest.h index 5f77f6bb0..2fca8539e 100644 --- a/libsrc/tests/xtest.h +++ b/libsrc/tests/xtest.h @@ -32,7 +32,7 @@ #endif #define RUN_ALL_TESTS(...) ({ \ - void (*tests[])(void) = {__VA_ARGS__}; \ + static void (*const tests[])(void) = {__VA_ARGS__}; \ for (size_t i = 0; i < sizeof(tests)/sizeof(*tests); ++i) \ (*tests[i])(); \ failed_suite_count < 255 ? failed_suite_count : 255; }) diff --git a/tests/xtest.h b/tests/xtest.h index 5f77f6bb0..2fca8539e 100644 --- a/tests/xtest.h +++ b/tests/xtest.h @@ -32,7 +32,7 @@ #endif #define RUN_ALL_TESTS(...) ({ \ - void (*tests[])(void) = {__VA_ARGS__}; \ + static void (*const tests[])(void) = {__VA_ARGS__}; \ for (size_t i = 0; i < sizeof(tests)/sizeof(*tests); ++i) \ (*tests[i])(); \ failed_suite_count < 255 ? failed_suite_count : 255; })