From: Djalal Harouni Date: Mon, 18 Aug 2014 10:59:59 +0000 (+0100) Subject: test: move shared definitions to kdbus-util.h to use them in other tests X-Git-Tag: upstream/0.20140911.160207utc~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b742a708c7fd597fdcf18e67078cf2f2da3b42e;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git test: move shared definitions to kdbus-util.h to use them in other tests Signed-off-by: Djalal Harouni --- 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;