]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/testutil/options.c
2 * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "../testutil.h"
11 #include "internal/nelem.h"
16 static int used
[100] = { 0 };
19 size_t test_get_argument_count(void)
21 return opt_num_rest();
24 char *test_get_argument(size_t n
)
26 char **argv
= opt_rest();
28 OPENSSL_assert(n
< sizeof(used
));
29 if ((int)n
>= opt_num_rest() || argv
== NULL
)
35 void opt_check_usage(void)
38 char **argv
= opt_rest();
39 int n
, arg_count
= opt_num_rest();
41 if (arg_count
> (int)OSSL_NELEM(used
))
42 n
= (int)OSSL_NELEM(used
);
45 for (i
= 0; i
< n
; i
++) {
47 test_printf_stderr("Warning ignored command-line argument %d: %s\n",
51 test_printf_stderr("Warning arguments %d and later unchecked\n", i
);
54 int opt_printf_stderr(const char *fmt
, ...)
60 ret
= test_vprintf_stderr(fmt
, ap
);