From: Andreas Schneider Date: Tue, 7 May 2024 05:45:50 +0000 (+0200) Subject: auth:creds: Add test for cli_credentials_get_username_obtained() X-Git-Tag: tdb-1.4.11~852 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9cf6c8dd4d256300df170b1b21a86fe02416018;p=thirdparty%2Fsamba.git auth:creds: Add test for cli_credentials_get_username_obtained() Signed-off-by: Andreas Schneider --- diff --git a/auth/credentials/tests/test_creds.c b/auth/credentials/tests/test_creds.c index 9a6c0053bc6..054b7321ce4 100644 --- a/auth/credentials/tests/test_creds.c +++ b/auth/credentials/tests/test_creds.c @@ -167,6 +167,7 @@ static void torture_creds_parse_string(void **state) TALLOC_CTX *mem_ctx = *state; struct cli_credentials *creds = NULL; enum credentials_obtained princ_obtained = CRED_UNINITIALISED; + enum credentials_obtained usr_obtained = CRED_UNINITIALISED; enum credentials_obtained pwd_obtained = CRED_UNINITIALISED; creds = cli_credentials_init(mem_ctx); @@ -215,7 +216,8 @@ static void torture_creds_parse_string(void **state) assert_int_equal(creds->domain_obtained, CRED_SPECIFIED); assert_string_equal(creds->username, "wurst@brot.realm"); - assert_int_equal(creds->username_obtained, CRED_SPECIFIED); + usr_obtained = cli_credentials_get_username_obtained(creds); + assert_int_equal(usr_obtained, CRED_SPECIFIED); assert_string_equal(creds->principal, "wurst@brot.realm"); princ_obtained = cli_credentials_get_principal_obtained(creds);