diff options
author | Tomas Mraz <tomas@openssl.org> | 2024-05-02 15:58:11 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-05-09 09:20:58 +0200 |
commit | 3e191f487907a474b6bd6e497043d1560972e7d7 (patch) | |
tree | 0946aa3bd87fc26fd5b7f8272ca7d89249ac7287 /test/context_internal_test.c | |
parent | 64bfdebdc049ee2ad5ca6456b87abbd67e6d5479 (diff) |
Add tests for conf_diagnostics
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24275)
Diffstat (limited to 'test/context_internal_test.c')
-rw-r--r-- | test/context_internal_test.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/context_internal_test.c b/test/context_internal_test.c index 8fea53fee1..c829d8111d 100644 --- a/test/context_internal_test.c +++ b/test/context_internal_test.c @@ -48,8 +48,36 @@ static int test_set0_default(void) return testresult; } +static int test_set_get_conf_diagnostics(void) +{ + OSSL_LIB_CTX *ctx = OSSL_LIB_CTX_new(); + int res = 0; + + if (!TEST_ptr(ctx)) + goto err; + + if (!TEST_false(OSSL_LIB_CTX_get_conf_diagnostics(ctx))) + goto err; + + OSSL_LIB_CTX_set_conf_diagnostics(ctx, 1); + + if (!TEST_true(OSSL_LIB_CTX_get_conf_diagnostics(ctx))) + goto err; + + OSSL_LIB_CTX_set_conf_diagnostics(ctx, 0); + + if (!TEST_false(OSSL_LIB_CTX_get_conf_diagnostics(ctx))) + goto err; + + res = 1; + err: + OSSL_LIB_CTX_free(ctx); + return res; +} + int setup_tests(void) { ADD_TEST(test_set0_default); + ADD_TEST(test_set_get_conf_diagnostics); return 1; } |