summaryrefslogtreecommitdiff
path: root/src/test/test-tmpfile-util.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2021-11-24 12:00:02 +0100
committerJan Janssen <medhefgo@web.de>2021-11-25 15:03:06 +0100
commit4f7452a8eb7a946efea927fae017d4d661097833 (patch)
tree413778cc0fb08fbbed0890130b5ba66c90581e61 /src/test/test-tmpfile-util.c
parent4d5ad9d951299c905453ac8e3769dc82b0a09fb4 (diff)
downloadsystemd-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-tmpfile-util.c')
-rw-r--r--src/test/test-tmpfile-util.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/test/test-tmpfile-util.c b/src/test/test-tmpfile-util.c
index 39d524e2b6..5e5f60bdc8 100644
--- a/src/test/test-tmpfile-util.c
+++ b/src/test/test-tmpfile-util.c
@@ -25,9 +25,7 @@ static void test_tempfn_random_one(const char *p, const char *extra, const char
assert_se(ret == r);
}
-static void test_tempfn_random(void) {
- log_info("/* %s */", __func__);
-
+TEST(tempfn_random) {
test_tempfn_random_one("", NULL, NULL, -EINVAL);
test_tempfn_random_one(".", NULL, NULL, -EADDRNOTAVAIL);
test_tempfn_random_one("..", NULL, NULL, -EINVAL);
@@ -69,9 +67,7 @@ static void test_tempfn_xxxxxx_one(const char *p, const char *extra, const char
assert_se(ret == r);
}
-static void test_tempfn_xxxxxx(void) {
- log_info("/* %s */", __func__);
-
+TEST(tempfn_xxxxxx) {
test_tempfn_xxxxxx_one("", NULL, NULL, -EINVAL);
test_tempfn_xxxxxx_one(".", NULL, NULL, -EADDRNOTAVAIL);
test_tempfn_xxxxxx_one("..", NULL, NULL, -EINVAL);
@@ -96,11 +92,4 @@ static void test_tempfn_xxxxxx(void) {
test_tempfn_xxxxxx_one("../foo/", "bar", "../.#barfoo", 0);
}
-int main(int argc, char **argv) {
- test_setup_logging(LOG_DEBUG);
-
- test_tempfn_random();
- test_tempfn_xxxxxx();
-
- return 0;
-}
+DEFINE_TEST_MAIN(LOG_DEBUG);