Update documentation regarding required output buffer memory size
[openssl.git] / test / bioprinttest.c
index 2c51b7a8b55d0fd5e8de5863fddc59e637e372a5..97151cdf1091ba366681b59799f2483d19754ccf 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2018 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
@@ -252,18 +252,44 @@ static int test_big(void)
     return 1;
 }
 
+typedef enum OPTION_choice {
+    OPT_ERR = -1,
+    OPT_EOF = 0,
+    OPT_PRINT,
+    OPT_TEST_ENUM
+} OPTION_CHOICE;
 
-int test_main(int argc, char **argv)
+const OPTIONS *test_get_options(void)
 {
-    if (argc == 2 && strcmp(argv[1], "-expected") == 0)
-        justprint = 1;
+    static const OPTIONS options[] = {
+        OPT_TEST_OPTIONS_DEFAULT_USAGE,
+        { "expected", OPT_PRINT, '-', "Output values" },
+        { NULL }
+    };
+    return options;
+}
+
+int setup_tests(void)
+{
+    OPTION_CHOICE o;
+
+    while ((o = opt_next()) != OPT_EOF) {
+        switch (o) {
+        case OPT_PRINT:
+            justprint = 1;
+            break;
+        case OPT_TEST_CASES:
+            break;
+        default:
+            return 0;
+        }
+    }
 
     ADD_TEST(test_big);
     ADD_ALL_TESTS(test_fp, nelem(pw_params));
     ADD_ALL_TESTS(test_zu, nelem(zu_data));
     ADD_ALL_TESTS(test_j, nelem(jf_data));
-
-    return run_tests(argv[0]);
+    return 1;
 }
 
 /*
@@ -302,3 +328,4 @@ int test_flush_stderr(void)
 {
     return fflush(stderr);
 }
+