From: Yu Watanabe Date: Mon, 7 Apr 2025 14:47:33 +0000 (+0900) Subject: test-notify-recv: fix message string X-Git-Tag: v258-rc1~877 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c019af5eed75e2b216643c877411925bf272aa78;p=thirdparty%2Fsystemd.git test-notify-recv: fix message string Follow-up for 2351bc991e3a4f1fbdaa2d53900980b6703babbd. Addresses https://github.com/systemd/systemd/pull/37016#discussion_r2031363409. --- diff --git a/src/test/test-notify-recv.c b/src/test/test-notify-recv.c index 80efe0c0f09..8634df9fd18 100644 --- a/src/test/test-notify-recv.c +++ b/src/test/test-notify-recv.c @@ -47,12 +47,12 @@ static int on_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) if (strv_contains(l, "FIRST_MESSAGE=1")) { ASSERT_STREQ(l[0], "FIRST_MESSAGE=1"); ASSERT_NULL(l[1]); - ASSERT_EQ(c->data, 0u); + ASSERT_EQ(++c->data, 1u); ASSERT_NULL(fds); } else if (strv_contains(l, "SECOND_MESSAGE=1")) { ASSERT_STREQ(l[0], "SECOND_MESSAGE=1"); ASSERT_STREQ(l[1], "ADDITIONAL_DATA=hoge"); - ASSERT_EQ(c->data, 1u); + ASSERT_EQ(++c->data, 2u); ASSERT_NOT_NULL(fds); ASSERT_EQ(fdset_size(fds), 2u); @@ -64,8 +64,6 @@ static int on_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) } } - c->data++; - return 0; } @@ -107,7 +105,7 @@ TEST(notify_socket_prepare) { ASSERT_OK_POSITIVE( sd_pid_notify_with_fds( 0, /* unset_environment = */ false, - "FIRST_MESSAGE=2\nADDITIONAL_DATA=hoge", (int[]) { fd1, fd2 }, 2)); + "SECOND_MESSAGE=1\nADDITIONAL_DATA=hoge", (int[]) { fd1, fd2 }, 2)); _exit(EXIT_SUCCESS); }