From: Andreas Schneider Date: Tue, 1 Sep 2020 11:33:19 +0000 (+0200) Subject: auth:creds:tests: Add test for cli_credentials_get_username_and_obtained() X-Git-Tag: tevent-0.11.0~981 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b78f4f093251bface20f307eb673ca632add34f;p=thirdparty%2Fsamba.git auth:creds:tests: Add test for cli_credentials_get_username_and_obtained() Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/auth/credentials/tests/test_creds.c b/auth/credentials/tests/test_creds.c index ea0a9f3bd6e..d7185c6734a 100644 --- a/auth/credentials/tests/test_creds.c +++ b/auth/credentials/tests/test_creds.c @@ -48,6 +48,7 @@ static void torture_creds_init(void **state) const char *username = NULL; const char *domain = NULL; const char *password = NULL; + enum credentials_obtained usr_obtained = CRED_UNINITIALISED; bool ok; creds = cli_credentials_init(mem_ctx); @@ -71,6 +72,11 @@ static void torture_creds_init(void **state) username = cli_credentials_get_username(creds); assert_string_equal(username, "brot"); + username = cli_credentials_get_username_and_obtained(creds, + &usr_obtained); + assert_int_equal(usr_obtained, CRED_SPECIFIED); + assert_string_equal(username, "brot"); + password = cli_credentials_get_password(creds); assert_null(password); ok = cli_credentials_set_password(creds, "SECRET", CRED_SPECIFIED);