Add a test for the certificate callback
[openssl.git] / test / wpackettest.c
index 2546ef3c6c3ab07e69f13a6ab3cfc9517df37887..773eef052525188b6e3f035ec7a33956b36c5d7c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2017 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
@@ -9,19 +9,29 @@
 
 #include <string.h>
 #include <openssl/buffer.h>
+
+#ifdef __VMS
+# pragma names save
+# pragma names as_is,shortened
+#endif
+
 #include "../ssl/packet_locl.h"
+
+#ifdef __VMS
+# pragma names restore
+#endif
+
 #include "testutil.h"
-#include "test_main_custom.h"
-
-const static unsigned char simple1[] = { 0xff };
-const static unsigned char simple2[] = { 0x01, 0xff };
-const static unsigned char simple3[] = { 0x00, 0x00, 0x00, 0x01, 0xff };
-const static unsigned char nestedsub[] = { 0x03, 0xff, 0x01, 0xff };
-const static unsigned char seqsub[] = { 0x01, 0xff, 0x01, 0xff };
-const static unsigned char empty[] = { 0x00 };
-const static unsigned char alloc[] = { 0x02, 0xfe, 0xff };
-const static unsigned char submem[] = { 0x03, 0x02, 0xfe, 0xff };
-const static unsigned char fixed[] = { 0xff, 0xff, 0xff };
+
+static const unsigned char simple1[] = { 0xff };
+static const unsigned char simple2[] = { 0x01, 0xff };
+static const unsigned char simple3[] = { 0x00, 0x00, 0x00, 0x01, 0xff };
+static const unsigned char nestedsub[] = { 0x03, 0xff, 0x01, 0xff };
+static const unsigned char seqsub[] = { 0x01, 0xff, 0x01, 0xff };
+static const unsigned char empty[] = { 0x00 };
+static const unsigned char alloc[] = { 0x02, 0xfe, 0xff };
+static const unsigned char submem[] = { 0x03, 0x02, 0xfe, 0xff };
+static const unsigned char fixed[] = { 0xff, 0xff, 0xff };
 
 static BUF_MEM *buf;
 
@@ -350,10 +360,8 @@ static int test_WPACKET_memcpy(void)
     return 1;
 }
 
-int test_main(int argc, char *argv[])
+int setup_tests(void)
 {
-    int testresult = 0;
-
     if (!TEST_ptr(buf = BUF_MEM_new()))
             return 0;
 
@@ -363,8 +371,10 @@ int test_main(int argc, char *argv[])
     ADD_TEST(test_WPACKET_set_flags);
     ADD_TEST(test_WPACKET_allocate_bytes);
     ADD_TEST(test_WPACKET_memcpy);
-    testresult = run_tests(argv[0]);
+    return 1;
+}
 
+void cleanup_tests(void)
+{
     BUF_MEM_free(buf);
-    return testresult;
 }