Skip to content

Commit

Permalink
Make test table as static const
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfkda committed Apr 22, 2024
1 parent 5676e48 commit 37ca9bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libsrc/tests/xtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; })
Expand Down
2 changes: 1 addition & 1 deletion tests/xtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; })
Expand Down

0 comments on commit 37ca9bc

Please sign in to comment.