2 * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include <openssl/evp.h>
13 static char *configfile = NULL;
16 * Test to make sure there are no leaks or failures from loading the config
19 static int test_double_config(void)
21 OSSL_LIB_CTX *ctx = OSSL_LIB_CTX_new();
23 EVP_MD *sha256 = NULL;
25 if (!TEST_ptr(configfile))
30 if (!TEST_true(OSSL_LIB_CTX_load_config(ctx, configfile)))
32 if (!TEST_true(OSSL_LIB_CTX_load_config(ctx, configfile)))
35 /* Check we can actually fetch something */
36 sha256 = EVP_MD_fetch(ctx, "SHA2-256", NULL);
37 if (!TEST_ptr(sha256))
43 OSSL_LIB_CTX_free(ctx);
47 OPT_TEST_DECLARE_USAGE("configfile\n")
51 if (!test_skip_common_options()) {
52 TEST_error("Error parsing test options\n");
56 if (!TEST_ptr(configfile = test_get_argument(0)))
59 ADD_TEST(test_double_config);