]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests.h: Get rid of TEST_REQ_RUNNING_SYSTEMD() 37414/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 11 May 2025 19:21:48 +0000 (21:21 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 13 May 2025 11:52:49 +0000 (13:52 +0200)
This only has a single user, let's just inline it and get rid of
the macro.

src/shared/tests.h
src/test/test-process-util.c

index 3a6747ca44d47c2fe5f50df9ef1aa94bda03a734..eae1d76ee03df14a320562f63055547a82ed4d82 100644 (file)
@@ -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);
 
index d24bcb768f12a99bf35edeb6b9ffe5c5dec8bd1d..6747054cc9266cc05155fa8cfcaef0fe706802df 100644 (file)
@@ -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());
         }
 }