diff options
author | Andreas Schneider <asn@samba.org> | 2020-09-01 13:33:19 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2021-04-28 03:43:34 +0000 |
commit | 3b78f4f093251bface20f307eb673ca632add34f (patch) | |
tree | 15037c8e839c27888632f6ddb592e68f49c0920e /auth | |
parent | f33844b70b6712fd5b909b730c5b4da582c06b20 (diff) | |
download | samba-3b78f4f093251bface20f307eb673ca632add34f.tar.gz |
auth:creds:tests: Add test for cli_credentials_get_username_and_obtained()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth')
-rw-r--r-- | auth/credentials/tests/test_creds.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); |