X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fsslbuffertest.c;h=b8b1f52dde1d875eff11d2edd21cf528e7b4d9a6;hp=72cb987ba0609708d1e0ad796aaa388cb027831d;hb=7d79d13a564d5c065318aa47f4cd511eece449e8;hpb=a58eb06d527c86492d4205feeb0e20bf19a1181d diff --git a/test/sslbuffertest.c b/test/sslbuffertest.c index 72cb987ba0..b8b1f52dde 100644 --- a/test/sslbuffertest.c +++ b/test/sslbuffertest.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL licenses, (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ static int test_func(int test) if (!TEST_size_t_eq(len, sizeof(testdata))) goto end; /* - * Now read the test data. It may take more attemps here because + * Now read the test data. It may take more attempts here because * it could fail once for each byte read, including all overhead * bytes from the record header/padding etc. */ @@ -150,31 +150,34 @@ static int test_func(int test) return result; } -int test_main(int argc, char *argv[]) +int global_init(void) { - int testresult = EXIT_FAILURE; - CRYPTO_set_mem_debug(1); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + return 1; +} - if (argc != 3) { - TEST_error("Invalid argument count\n"); - goto end; - } +int setup_tests(void) +{ + char *cert, *pkey; + + if (!TEST_ptr(cert = test_get_argument(0)) + || !TEST_ptr(pkey = test_get_argument(1))) + return 0; if (!create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), - &serverctx, &clientctx, argv[1], argv[2])) { + TLS1_VERSION, TLS_MAX_VERSION, + &serverctx, &clientctx, cert, pkey)) { TEST_error("Failed to create SSL_CTX pair\n"); - goto end; + return 0; } ADD_ALL_TESTS(test_func, 9); + return 1; +} - testresult = run_tests(argv[0]); - - end: +void cleanup_tests(void) +{ SSL_CTX_free(clientctx); SSL_CTX_free(serverctx); - - return testresult; }