diff options
author | Andreas Schneider <asn@samba.org> | 2020-09-01 15:36:20 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2021-04-28 03:43:34 +0000 |
commit | fcba4eb4329641c535b809d268b04474df596c56 (patch) | |
tree | f31ebb35c231d09ce31483ecc5d6ec860a884df2 /auth/credentials/tests | |
parent | bd2b18250158ba90768c304d2c7cb4d7e81d8dcd (diff) | |
download | samba-fcba4eb4329641c535b809d268b04474df596c56.tar.gz |
auth:creds:tests: Add test for cli_credentials_get_password_and_obtained()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth/credentials/tests')
-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 d7185c6734a..0f482e38eaa 100644 --- a/auth/credentials/tests/test_creds.c +++ b/auth/credentials/tests/test_creds.c @@ -49,6 +49,7 @@ static void torture_creds_init(void **state) const char *domain = NULL; const char *password = NULL; enum credentials_obtained usr_obtained = CRED_UNINITIALISED; + enum credentials_obtained pwd_obtained = CRED_UNINITIALISED; bool ok; creds = cli_credentials_init(mem_ctx); @@ -85,6 +86,11 @@ static void torture_creds_init(void **state) password = cli_credentials_get_password(creds); assert_string_equal(password, "SECRET"); + password = cli_credentials_get_password_and_obtained(creds, + &pwd_obtained); + assert_int_equal(pwd_obtained, CRED_SPECIFIED); + assert_string_equal(password, "SECRET"); + /* Run dump to check it works */ cli_credentials_dump(creds); } |