From f896c0264e4c08edbad2c57b04a2a24d296f1778 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sat, 22 Feb 2025 20:57:33 +0100 Subject: [PATCH] unittest: fix potential name collisions --- impl/test/unittest/unittest.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/impl/test/unittest/unittest.h b/impl/test/unittest/unittest.h index 46adabd..dd63c36 100644 --- a/impl/test/unittest/unittest.h +++ b/impl/test/unittest/unittest.h @@ -4,16 +4,16 @@ #include #define ASSERT_RESULT(expected, call) { \ - result_t result = call; \ - if(result != expected) { \ - LOG(LVL_FATAL, "L%d: result = %i, expected = %i!", __LINE__, result, expected); \ + result_t __result = call; \ + if(__result != expected) { \ + LOG(LVL_FATAL, "L%d: result = %i, expected = %i!", __LINE__, __result, expected); \ exit(1); \ } \ } #define ASSERT_TRUE(call) { \ - bool result = call; \ - if(!result) { \ + bool __result = call; \ + if(!__result) { \ LOG(LVL_FATAL, "L%d: "#call" evaluates to false"); \ exit(1); \ } \ @@ -22,17 +22,17 @@ #define ASSERT_FALSE(call) ASSERT_TRUE(!call) #define ASSERT_EQUAL_INT(expected, call) { \ - int64_t result = (int64_t)call; \ - if(result != expected) { \ - LOG(LVL_FATAL, "L%d: result = %"PRIi64", expected = %"PRIi64"!", __LINE__, result, expected); \ + int64_t __result = (int64_t)call; \ + if(__result != expected) { \ + LOG(LVL_FATAL, "L%d: result = %"PRIi64", expected = %"PRIi64"!", __LINE__, __result, expected); \ exit(1); \ } \ } #define ASSERT_EQUAL_UINT(expected, call) { \ - uint64_t result = (uint64_t)call; \ - if(result != expected) { \ - LOG(LVL_FATAL, "L%d: result = %"PRIu64", expected = %"PRIu64"!", __LINE__, result, expected); \ + uint64_t __result = (uint64_t)call; \ + if(__result != expected) { \ + LOG(LVL_FATAL, "L%d: result = %"PRIu64", expected = %"PRIu64"!", __LINE__, __result, expected); \ exit(1); \ } \ }