From 8b742a708c7fd597fdcf18e67078cf2f2da3b42e Mon Sep 17 00:00:00 2001 From: Djalal Harouni Date: Mon, 18 Aug 2014 11:59:59 +0100 Subject: [PATCH] test: move shared definitions to kdbus-util.h to use them in other tests Signed-off-by: Djalal Harouni --- test/kdbus-util.h | 12 ++++++++++++ test/test-kdbus.c | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/kdbus-util.h b/test/kdbus-util.h index 765f6af..342ea9b 100644 --- a/test/kdbus-util.h +++ b/test/kdbus-util.h @@ -29,6 +29,18 @@ (uint8_t *)(item) < (uint8_t *)(head) + (head)->size; \ item = KDBUS_ITEM_NEXT(item)) +enum { + CHECK_OK, + CHECK_SKIP, + CHECK_ERR, +}; + +#define ASSERT_RETURN(cond) \ + if (!(cond)) { \ + fprintf(stderr, "Assertion '%s' failed in %s(), line %d\n", #cond, __func__, __LINE__); \ + return CHECK_ERR; \ + } + /* Dump as user of process, useful for user namespace testing */ #define SUID_DUMP_USER 1 diff --git a/test/test-kdbus.c b/test/test-kdbus.c index 2db7eb8..482dd5b 100644 --- a/test/test-kdbus.c +++ b/test/test-kdbus.c @@ -18,12 +18,6 @@ #include "kdbus-util.h" #include "kdbus-enum.h" -enum { - CHECK_OK, - CHECK_SKIP, - CHECK_ERR, -}; - enum { CHECK_CREATE_BUS = 1 << 0, CHECK_CREATE_CONN = 1 << 1, @@ -61,12 +55,6 @@ struct kdbus_check { KDBUS_ATTACH_SECLABEL | \ KDBUS_ATTACH_AUDIT -#define ASSERT_RETURN(cond) \ - if (!(cond)) { \ - fprintf(stderr, "Assertion '%s' failed in %s(), line %d\n", #cond, __func__, __LINE__); \ - return CHECK_ERR; \ - } - static struct kdbus_conn *make_conn(const char *buspath, uint64_t flags) { int ret; -- 2.34.1