Fix copyright year issues
[openssl.git] / test / dtls_mtu_test.c
index 50f952b2cea74c19506f7cc803d06d0b8a50cdc3..b3ea3cf44c111eff0f471655e82a87a493286ba3 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (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
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
-#include "ssltestlib.h"
+#include "helpers/ssltestlib.h"
 #include "testutil.h"
 
 /* for SSL_READ_ETM() */
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 
 static int debug = 0;
 
@@ -73,7 +73,7 @@ static int mtu_test(SSL_CTX *ctx, const char *cs, int no_etm)
         goto end;
 
     if (debug)
-        printf("Channel established\n");
+        TEST_info("Channel established");
 
     /* For record MTU values between 500 and 539, call DTLS_get_data_mtu()
      * to query the payload MTU which will fit. */
@@ -104,7 +104,7 @@ static int mtu_test(SSL_CTX *ctx, const char *cs, int no_etm)
             goto end;
         reclen = BIO_read(sc_bio, buf, sizeof(buf));
         if (debug)
-            printf("record %"OSSLzu" for payload %"OSSLzu"\n", reclen, s);
+            TEST_info("record %zu for payload %zu", reclen, s);
 
         for (i = 0; i < 30; i++) {
             /* DTLS_get_data_mtu() with record MTU 500+i returned mtus[i] ... */
@@ -168,7 +168,7 @@ static int run_mtu_tests(void)
         const char *cipher_name = SSL_CIPHER_get_name(cipher);
 
         /* As noted above, only one test for each enc/mac variant. */
-        if (strncmp(cipher_name, "PSK-", 4) != 0)
+        if (!HAS_PREFIX(cipher_name, "PSK-"))
             continue;
 
         if (!TEST_int_gt(ret = mtu_test(ctx, cipher_name, 0), 0))
@@ -189,7 +189,8 @@ static int run_mtu_tests(void)
     return ret;
 }
 
-void register_tests()
+int setup_tests(void)
 {
     ADD_TEST(run_mtu_tests);
+    return 1;
 }