Test the storeutl expectation options
[openssl.git] / test / v3nametest.c
index cb7b799aecddd798b028594f9d7942a10d40cb20..08684eaf76746fd15ea38a53f4d1c1d9a5836f3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2012-2018 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
@@ -8,11 +8,17 @@
  */
 
 #include <string.h>
-#include "e_os.h"
+
+#include <openssl/e_os2.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include "internal/nelem.h"
 #include "testutil.h"
 
+#ifdef OPENSSL_SYS_WINDOWS
+# define strcasecmp _stricmp
+#endif
+
 static const char *const names[] = {
     "a", "b", ".", "*", "@",
     ".a", "a.", ".b", "b.", ".*", "*.", "*@", "@*", "a@", "@a", "b@", "..",
@@ -251,7 +257,7 @@ static X509 *make_cert()
 
     if (!TEST_ptr(crt = X509_new()))
         return NULL;
-    if (!TEST_true(X509_set_version(crt, 3))) {
+    if (!TEST_true(X509_set_version(crt, 2))) {
         X509_free(crt);
         return NULL;
     }
@@ -353,7 +359,8 @@ static int call_run_cert(int i)
     return failed == 0;
 }
 
-void register_tests(void)
+int setup_tests(void)
 {
-    ADD_ALL_TESTS(call_run_cert, sizeof(name_fns) / sizeof(name_fns[0]));
+    ADD_ALL_TESTS(call_run_cert, OSSL_NELEM(name_fns));
+    return 1;
 }