From b166980c8e6618a66aa0ec82e77c40bb305404be Mon Sep 17 00:00:00 2001 From: Karthick Ariyaratnam Date: Thu, 9 May 2024 17:26:15 -0400 Subject: [PATCH] Fix UNUSED repetition issue in test sources (#475) This is a follow-up PR to address UNUSED repetition issue (see https://github.com/valkey-io/valkey/pull/446#discussion_r1593204956) in different test source files. Signed-off-by: Karthick Ariyaratnam --- src/unit/test_help.h | 2 ++ src/unit/test_kvstore.c | 1 - src/unit/test_util.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unit/test_help.h b/src/unit/test_help.h index 6fc5b4c37..ec09295a9 100644 --- a/src/unit/test_help.h +++ b/src/unit/test_help.h @@ -43,6 +43,8 @@ #define TEST_ASSERT(_c) TEST_ASSERT_MESSAGE("Failed assertion: " #_c, _c) +#ifndef UNUSED #define UNUSED(x) (void)(x) +#endif #endif diff --git a/src/unit/test_kvstore.c b/src/unit/test_kvstore.c index 65a8389a8..7542ffc53 100644 --- a/src/unit/test_kvstore.c +++ b/src/unit/test_kvstore.c @@ -1,5 +1,4 @@ #include "../kvstore.c" -#undef UNUSED #include "test_help.h" uint64_t hashTestCallback(const void *key) { diff --git a/src/unit/test_util.c b/src/unit/test_util.c index b168442fc..c5dad630b 100644 --- a/src/unit/test_util.c +++ b/src/unit/test_util.c @@ -4,7 +4,6 @@ #include "../config.h" #include "../util.h" -#undef UNUSED #include "test_help.h" int test_string2ll(int argc, char **argv, int flags) {