From b60f08e782e50b7ee2bed2e655570f6a5780199c Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Wed, 12 Apr 2023 13:30:56 -0600 Subject: [PATCH] test: add ASSERT_OK (#3957) The majority of uses for ASSERT_EQ are to check if the return value is 0. So make a macro specifically for this and make things easier to read. --- test/task.h | 1 + 1 file changed, 1 insertion(+) diff --git a/test/task.h b/test/task.h index c90804dd..fa6cc0ed 100644 --- a/test/task.h +++ b/test/task.h @@ -198,6 +198,7 @@ typedef enum { #define ASSERT_LE(a, b) ASSERT_BASE(a, <=, b, int64_t, PRId64) #define ASSERT_LT(a, b) ASSERT_BASE(a, <, b, int64_t, PRId64) #define ASSERT_NE(a, b) ASSERT_BASE(a, !=, b, int64_t, PRId64) +#define ASSERT_OK(a) ASSERT_BASE(a, ==, 0, int64_t, PRId64) #define ASSERT_UINT64_EQ(a, b) ASSERT_BASE(a, ==, b, uint64_t, PRIu64) #define ASSERT_UINT64_GE(a, b) ASSERT_BASE(a, >=, b, uint64_t, PRIu64)