Fixed deadlock in CRYPTO_THREAD_run_once for Windows
[openssl.git] / test / heartbeat_test.c
index 453615a8f42694abe91061450feb2fdc6d697701..9f6c6e538ab981f4065879948ce5bc20aef2a0ce 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
 /*-
  * Unit test for TLS heartbeats.
  *
 /*-
  * Unit test for TLS heartbeats.
  *
@@ -92,7 +101,7 @@ static HEARTBEAT_TEST_FIXTURE set_up(const char *const test_case_name,
         goto fail;
     }
 
         goto fail;
     }
 
-    if (!ssl_init_wbio_buffer(fixture.s, 1)) {
+    if (!ssl_init_wbio_buffer(fixture.s)) {
         fprintf(stderr, "Failed to set up wbio buffer for test: %s\n",
                 test_case_name);
         setup_ok = 0;
         fprintf(stderr, "Failed to set up wbio buffer for test: %s\n",
                 test_case_name);
         setup_ok = 0;
@@ -124,7 +133,7 @@ static HEARTBEAT_TEST_FIXTURE set_up(const char *const test_case_name,
 static HEARTBEAT_TEST_FIXTURE set_up_dtls(const char *const test_case_name)
 {
     HEARTBEAT_TEST_FIXTURE fixture = set_up(test_case_name,
 static HEARTBEAT_TEST_FIXTURE set_up_dtls(const char *const test_case_name)
 {
     HEARTBEAT_TEST_FIXTURE fixture = set_up(test_case_name,
-                                            DTLSv1_server_method());
+                                            DTLS_server_method());
     fixture.process_heartbeat = dtls1_process_heartbeat;
 
     /*
     fixture.process_heartbeat = dtls1_process_heartbeat;
 
     /*
@@ -146,7 +155,6 @@ static int dummy_handshake(SSL *s)
 
 static void tear_down(HEARTBEAT_TEST_FIXTURE fixture)
 {
 
 static void tear_down(HEARTBEAT_TEST_FIXTURE fixture)
 {
-    ERR_print_errors_fp(stderr);
     SSL_free(fixture.s);
     SSL_CTX_free(fixture.ctx);
 }
     SSL_free(fixture.s);
     SSL_CTX_free(fixture.ctx);
 }
@@ -356,7 +364,6 @@ int main(int argc, char *argv[])
     ADD_TEST(test_dtls1_heartbleed_excessive_plaintext_length);
 
     result = run_tests(argv[0]);
     ADD_TEST(test_dtls1_heartbleed_excessive_plaintext_length);
 
     result = run_tests(argv[0]);
-    ERR_print_errors_fp(stderr);
     return result;
 }
 
     return result;
 }