From cfc9d3bef9536399eac20b748fac5c11e11eb99e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sun, 11 May 2025 21:21:48 +0200 Subject: [PATCH] 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. --- src/shared/tests.h | 7 ------- src/test/test-process-util.c | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) 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()); } } -- 2.47.3