summaryrefslogtreecommitdiff
path: root/src/test/test-install-file.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-install-file.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-install-file.c')
-rw-r--r--src/test/test-install-file.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/test/test-install-file.c b/src/test/test-install-file.c
index 55d77ac236..7112775507 100644
--- a/src/test/test-install-file.c
+++ b/src/test/test-install-file.c
@@ -8,13 +8,11 @@
#include "tmpfile-util.h"
#include "umask-util.h"
-static void test_install_file(void) {
+TEST(install_file) {
_cleanup_(rm_rf_physical_and_freep) char *p = NULL;
_cleanup_free_ char *a = NULL, *b = NULL, *c = NULL;
struct stat stat1, stat2;
- log_info("/* %s */", __func__);
-
assert_se(mkdtemp_malloc(NULL, &p) >= 0);
assert_se(a = path_join(p, "foo"));
assert_se(b = path_join(p, "bar"));
@@ -63,10 +61,4 @@ static void test_install_file(void) {
assert_se(install_file(AT_FDCWD, b, AT_FDCWD, a, INSTALL_FSYNC_FULL|INSTALL_REPLACE) == 0);
}
-int main(int argc, char *argv[]) {
- test_setup_logging(LOG_INFO);
-
- test_install_file();
-
- return 0;
-}
+DEFINE_TEST_MAIN(LOG_INFO);