diff options
author | Jan Janssen <medhefgo@web.de> | 2021-11-24 12:00:02 +0100 |
---|---|---|
committer | Jan Janssen <medhefgo@web.de> | 2021-11-25 15:03:06 +0100 |
commit | 4f7452a8eb7a946efea927fae017d4d661097833 (patch) | |
tree | 413778cc0fb08fbbed0890130b5ba66c90581e61 /src/test/test-verbs.c | |
parent | test-time-util: Properly restore TZ variable (diff) | |
download | systemd-4f7452a8eb7a946efea927fae017d4d661097833.tar.xz systemd-4f7452a8eb7a946efea927fae017d4d661097833.zip |
test: Use TEST macro
This converts to TEST macro where it is trivial.
Some additional notable changes:
- simplify HAVE_LIBIDN #ifdef in test-dns-domain.c
- use saved_argc/saved_argv in test-copy.c, test-path-util.c,
test-tmpfiles.c and test-unit-file.c
Diffstat (limited to 'src/test/test-verbs.c')
-rw-r--r-- | src/test/test-verbs.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/test/test-verbs.c b/src/test/test-verbs.c index b7a0cbf527..6e30794fa3 100644 --- a/src/test/test-verbs.c +++ b/src/test/test-verbs.c @@ -4,6 +4,7 @@ #include "macro.h" #include "strv.h" +#include "tests.h" #include "verbs.h" static int noop_dispatcher(int argc, char *argv[], void *userdata) { @@ -14,7 +15,7 @@ static int noop_dispatcher(int argc, char *argv[], void *userdata) { optind = 0; \ assert_se(dispatch_verb(strv_length(argv), argv, verbs, NULL) == expected); -static void test_verbs(void) { +TEST(verbs) { static const Verb verbs[] = { { "help", VERB_ANY, VERB_ANY, 0, noop_dispatcher }, { "list-images", VERB_ANY, 1, 0, noop_dispatcher }, @@ -46,7 +47,7 @@ static void test_verbs(void) { test_dispatch_one(STRV_MAKE_EMPTY, verbs, 0); } -static void test_verbs_no_default(void) { +TEST(verbs_no_default) { static const Verb verbs[] = { { "help", VERB_ANY, VERB_ANY, 0, noop_dispatcher }, {}, @@ -55,9 +56,4 @@ static void test_verbs_no_default(void) { test_dispatch_one(STRV_MAKE(NULL), verbs, -EINVAL); } -int main(int argc, char *argv[]) { - test_verbs(); - test_verbs_no_default(); - - return 0; -} +DEFINE_TEST_MAIN(LOG_INFO); |