From: Daan De Meyer Date: Sun, 11 May 2025 19:21:48 +0000 (+0200) Subject: tests.h: Get rid of TEST_REQ_RUNNING_SYSTEMD() X-Git-Tag: v258-rc1~632^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F37414%2Fhead;p=thirdparty%2Fsystemd.git tests.h: Get rid of TEST_REQ_RUNNING_SYSTEMD() This only has a single user, let's just inline it and get rid of the macro. --- diff --git a/src/shared/tests.h b/src/shared/tests.h index 3a6747ca44d..eae1d76ee03 100644 --- a/src/shared/tests.h +++ b/src/shared/tests.h @@ -91,13 +91,6 @@ bool can_memlock(void); size_t name##_len = 0; \ assert_se(unhexmem_full(hex, strlen_ptr(hex), false, &name, &name##_len) >= 0); -#define TEST_REQ_RUNNING_SYSTEMD(x) \ - if (sd_booted() > 0) { \ - x; \ - } else { \ - printf("systemd not booted, skipping '%s'\n", #x); \ - } - /* Provide a convenient way to check if we're running in CI. */ const char* ci_environment(void); diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c index d24bcb768f1..6747054cc92 100644 --- a/src/test/test-process-util.c +++ b/src/test/test-process-util.c @@ -113,7 +113,8 @@ TEST(pid_get_comm) { (void) parse_pid(saved_argv[1], &pid); test_pid_get_comm_one(pid); } else { - TEST_REQ_RUNNING_SYSTEMD(test_pid_get_comm_one(1)); + if (sd_booted() > 0) + test_pid_get_comm_one(1); test_pid_get_comm_one(getpid()); } }