From: Andreas Schneider Date: Tue, 7 May 2024 05:54:46 +0000 (+0200) Subject: auth:creds: Add test for cli_credentials_get_principal_obtained() X-Git-Tag: tdb-1.4.11~858 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4723d695608e7737176e4f6eb407885a38989fc8;p=thirdparty%2Fsamba.git auth:creds: Add test for cli_credentials_get_principal_obtained() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15018 Signed-off-by: Andreas Schneider --- diff --git a/auth/credentials/tests/test_creds.c b/auth/credentials/tests/test_creds.c index 2cb2e6d0e34..2a41c78623b 100644 --- a/auth/credentials/tests/test_creds.c +++ b/auth/credentials/tests/test_creds.c @@ -166,6 +166,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; creds = cli_credentials_init(mem_ctx); assert_non_null(creds); @@ -216,7 +217,8 @@ static void torture_creds_parse_string(void **state) assert_int_equal(creds->username_obtained, CRED_SPECIFIED); assert_string_equal(creds->principal, "wurst@brot.realm"); - assert_int_equal(creds->principal_obtained, CRED_SPECIFIED); + princ_obtained = cli_credentials_get_principal_obtained(creds); + assert_int_equal(princ_obtained, CRED_SPECIFIED); assert_string_equal(creds->password, "BROT"); assert_int_equal(creds->password_obtained, CRED_SPECIFIED);