Example #1
0
static void check_arg_usage(void)
{
    size_t i, n = arg_count < OSSL_NELEM(arg_used) ? arg_count
                                                   : OSSL_NELEM(arg_used);

    for (i = 0; i < n; i++)
        if (!arg_used[i+1])
            test_printf_stderr("Warning ignored command-line argument %d: %s\n",
                               i, args[i+1]);
    if (i < arg_count)
        test_printf_stderr("Warning arguments %zu and later unchecked\n", i);
}
Example #2
0
int main(int argc, char *argv[])
{
    int ret = EXIT_FAILURE;

    test_open_streams();

    if (!global_init()) {
        test_printf_stderr("Global init failed - aborting\n");
        return ret;
    }

    arg_count = argc - 1;
    args = argv;

    setup_test_framework();

    if (setup_tests())
        ret = run_tests(argv[0]);
    cleanup_tests();
    check_arg_usage();

    ret = pulldown_test_framework(ret);
    test_close_streams();
    return ret;    
}
Example #3
0
void opt_check_usage(void)
{
    int i;
    char **argv = opt_rest();
    int n, arg_count = opt_num_rest();

    if (arg_count > (int)OSSL_NELEM(used))
        n = (int)OSSL_NELEM(used);
    else
        n = arg_count;
    for (i = 0; i < n; i++) {
        if (used[i] == 0)
            test_printf_stderr("Warning ignored command-line argument %d: %s\n",
                               i, argv[i]);
    }
    if (i < arg_count)
        test_printf_stderr("Warning arguments %d and later unchecked\n", i);
}