Update copyright year
[openssl.git] / test / d2i_test.c
index 13f6c0ca2299792f262e432a442ed34c12826954..c095dfef37e844ef9312ff53fbe5009ff5616610 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * 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
@@ -106,6 +106,8 @@ static int test_bad_asn1(void)
     return ret;
 }
 
+OPT_TEST_DECLARE_USAGE("item_name expected_error test_file.der\n")
+
 /*
  * Usage: d2i_test <name> <type> <file>, e.g.
  * d2i_test generalname bad_generalname.der
@@ -125,12 +127,15 @@ int setup_tests(void)
         {"compare", ASN1_COMPARE}
     };
 
+    if (!test_skip_common_options()) {
+        TEST_error("Error parsing test options\n");
+        return 0;
+    }
+
     if (!TEST_ptr(test_type_name = test_get_argument(0))
             || !TEST_ptr(expected_error_string = test_get_argument(1))
-            || !TEST_ptr(test_file = test_get_argument(2))) {
-        TEST_note("Usage: d2i_test item_name expected_error file.der");
+            || !TEST_ptr(test_file = test_get_argument(2)))
         return 0;
-    }
 
     item_type = ASN1_ITEM_lookup(test_type_name);