From efeb864cb547a2cbf96dc0053a8bdb4d9190b364 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:45 +0200 Subject: Merging upstream version 256. Signed-off-by: Daniel Baumann --- src/test/test-ask-password-api.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/test/test-ask-password-api.c') diff --git a/src/test/test-ask-password-api.c b/src/test/test-ask-password-api.c index b24159e..e58e868 100644 --- a/src/test/test-ask-password-api.c +++ b/src/test/test-ask-password-api.c @@ -5,14 +5,19 @@ #include "tests.h" TEST(ask_password) { - int r; _cleanup_strv_free_ char **ret = NULL; + int r; + + static const AskPasswordRequest req = { + .message = "hello?", + .keyring = "da key", + }; - r = ask_password_tty(-1, "hello?", "da key", 0, ASK_PASSWORD_CONSOLE_COLOR, NULL, &ret); + r = ask_password_tty(-EBADF, &req, /* until= */ 0, /* flags= */ ASK_PASSWORD_CONSOLE_COLOR, /* flag_file= */ NULL, &ret); if (r == -ECANCELED) - assert_se(ret == NULL); + ASSERT_NULL(ret); else { - assert_se(r >= 0); + ASSERT_OK(r); assert_se(strv_length(ret) == 1); log_info("Got \"%s\"", *ret); } -- cgit v1.2.3