Commit 8793f012 authored by Matt Caswell's avatar Matt Caswell
Browse files

Clean up the tests for auto-init/de-init



Remove the need to explicitly initialise/deinitialise for the tests

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent b9f75707
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ int main(int argc, char *argv[])
                                 * notices the failure, see test_bn in
                                 * test/Makefile.ssl */
    (void)BIO_flush(out);
    ERR_load_crypto_strings();

    ERR_print_errors_fp(stderr);
    EXIT(1);
}
+0 −7
Original line number Diff line number Diff line
@@ -103,9 +103,6 @@ int main(int argc, char *argv[])
    int testresult = 0;
    int currtest = 0;

    SSL_library_init();
    SSL_load_error_strings();

    err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);

    CRYPTO_set_mem_debug(1);
@@ -212,10 +209,6 @@ int main(int argc, char *argv[])
        }
    }

    ERR_free_strings();
    ERR_remove_thread_state(NULL);
    EVP_cleanup();
    CRYPTO_cleanup_all_ex_data();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
    if (CRYPTO_mem_leaks(err) <= 0)
        testresult = 0;
+0 −10
Original line number Diff line number Diff line
@@ -493,8 +493,6 @@ int main(int argc, char *argv[])
        return 0;
    }

    SSL_library_init();
    SSL_load_error_strings();

    ctx = SSL_CTX_new(TLS_client_method());
    if (SSL_CTX_dane_enable(ctx) <= 0) {
@@ -526,14 +524,6 @@ end:
    (void) fclose(f);
    SSL_CTX_free(ctx);

#ifndef OPENSSL_NO_ENGINE
    ENGINE_cleanup();
#endif
    CONF_modules_unload(1);
    CRYPTO_cleanup_all_ex_data();
    ERR_free_strings();
    ERR_remove_thread_state(NULL);
    EVP_cleanup();
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
    if (CRYPTO_mem_leaks(bio_err) <= 0)
        ret = 1;
+1 −4
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ int main(int argc, char **argv)
    CRYPTO_set_mem_debug(1);
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);

    ERR_load_crypto_strings();
    RAND_seed(rnd_seed, sizeof rnd_seed);

    BIO_printf(bio_err, "test generation of DSA parameters\n");
@@ -211,9 +210,7 @@ int main(int argc, char **argv)
        ERR_print_errors(bio_err);
    DSA_free(dsa);
    BN_GENCB_free(cb);
    CRYPTO_cleanup_all_ex_data();
    ERR_remove_thread_state(NULL);
    ERR_free_strings();

#ifndef OPENSSL_NO_CRYPTO_MDEBUG
    if (CRYPTO_mem_leaks(bio_err) <= 0)
        ret = 0;
+1 −2
Original line number Diff line number Diff line
@@ -509,8 +509,7 @@ int main(int argc, char *argv[])
    OPENSSL_free(curves);
    BN_CTX_free(ctx);
    BIO_free(out);
    CRYPTO_cleanup_all_ex_data();
    ERR_remove_thread_state(NULL);

#ifndef OPENSSL_NO_CRYPTO_MDEBUG
    if (CRYPTO_mem_leaks_fp(stderr) <= 0)
        ret = 1;
Loading