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-sd-path.c | |
parent | 4d5ad9d951299c905453ac8e3769dc82b0a09fb4 (diff) | |
download | systemd-4f7452a8eb7a946efea927fae017d4d661097833.tar.gz |
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-sd-path.c')
-rw-r--r-- | src/test/test-sd-path.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/test/test-sd-path.c b/src/test/test-sd-path.c index 75436ab1ce..10a8a4a63f 100644 --- a/src/test/test-sd-path.c +++ b/src/test/test-sd-path.c @@ -7,9 +7,7 @@ #include "strv.h" #include "tests.h" -static void test_sd_path_lookup(void) { - log_info("/* %s */", __func__); - +TEST(sd_path_lookup) { for (uint64_t i = 0; i < _SD_PATH_MAX; i++) { _cleanup_free_ char *t = NULL, *s = NULL; int r; @@ -31,9 +29,7 @@ static void test_sd_path_lookup(void) { assert_se(sd_path_lookup(_SD_PATH_MAX, NULL, &tt) == -EOPNOTSUPP); } -static void test_sd_path_lookup_strv(void) { - log_info("/* %s */", __func__); - +TEST(sd_path_lookup_strv) { for (uint64_t i = 0; i < _SD_PATH_MAX; i++) { _cleanup_strv_free_ char **t = NULL, **s = NULL; char **item; @@ -61,9 +57,4 @@ static void test_sd_path_lookup_strv(void) { assert_se(sd_path_lookup(_SD_PATH_MAX, NULL, &tt) == -EOPNOTSUPP); } -int main(void) { - test_setup_logging(LOG_DEBUG); - - test_sd_path_lookup(); - test_sd_path_lookup_strv(); -} +DEFINE_TEST_MAIN(LOG_DEBUG); |