From a12b50f8fa16c7683b05a64480e1ef0bced082db Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 22 Feb 2017 10:44:33 +0100 Subject: [PATCH] tests: new assertion helper Add the GU_ASSERT_RET_OK() macro which checks if an integer (normally returned from a function call) equals 0 - indicating a correct result. Signed-off-by: Bartosz Golaszewski --- tests/unit/gpiod-unit.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/gpiod-unit.h b/tests/unit/gpiod-unit.h index 4c0aff9..bda0bd0 100644 --- a/tests/unit/gpiod-unit.h +++ b/tests/unit/gpiod-unit.h @@ -88,6 +88,7 @@ void gu_free_chip_iter(struct gpiod_chip_iter **iter); } while (0) #define GU_ASSERT_NOT_NULL(ptr) GU_ASSERT(ptr != NULL) +#define GU_ASSERT_RET_OK(status) GU_ASSERT(status == 0) #define GU_ASSERT_NULL(ptr) GU_ASSERT(ptr == NULL) #define GU_ASSERT_EQ(a1, a2) GU_ASSERT(a1 == a2) #define GU_ASSERT_STR_EQ(s1, s2) GU_ASSERT(strcmp(s1, s2) == 0) -- 2.30.2