X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-argp.c;h=a96dee86a12631d77f9ea6fdfc80bf095f5996d2;hb=74540d44dc16bfd3546e39ae2d7262f32a4147ab;hp=675951fbd3f3231b4e56e3d23df70719b547a925;hpb=11fbc57405a118e6ec9a3ebc19bbf5ececdae4d6;p=gnulib.git diff --git a/tests/test-argp.c b/tests/test-argp.c index 675951fbd..a96dee86a 100644 --- a/tests/test-argp.c +++ b/tests/test-argp.c @@ -1,5 +1,5 @@ /* Test suite for argp. - Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc. This file is part of the GNUlib Library. This program is free software: you can redistribute it and/or modify @@ -21,9 +21,7 @@ #include #include -#if HAVE_STRING_H -# include -#endif +#include #if HAVE_STRINGS_H # include #endif @@ -228,7 +226,7 @@ parse_opt (int key, char *arg, struct argp_state *state) { case ARGP_KEY_INIT: for (i = 0; state->root_argp->children[i].argp; i++) - state->child_inputs[i] = args; + state->child_inputs[i] = args; break; case 't': @@ -262,20 +260,20 @@ struct argp test_argp = { #define INIT_TEST_COMMON(n) \ int argc = NARGS (argv); \ struct test_args test_args; \ - init_args(test_args); \ + init_args (test_args); \ test_number = n; #define INIT_TEST1(n, arg1) \ char *argv[] = { ARGV0, arg1, NULL }; \ - INIT_TEST_COMMON(n) + INIT_TEST_COMMON (n) #define INIT_TEST2(n, arg1, arg2) \ char *argv[] = { ARGV0, arg1, arg2, NULL }; \ - INIT_TEST_COMMON(n) + INIT_TEST_COMMON (n) #define INIT_TEST3(n, arg1, arg2, arg3) \ char *argv[] = { ARGV0, arg1, arg2, arg3, NULL }; \ - INIT_TEST_COMMON(n) + INIT_TEST_COMMON (n) int test_number; unsigned failure_count = 0; @@ -348,7 +346,7 @@ test6 (struct argp *argp) void test_optional (struct argp *argp, int argc, char **argv, - struct test_args *args, char *val, char *a) + struct test_args *args, const char *val, const char *a) { int index; if (argp_parse (argp, argc, argv, 0, &index, args)) @@ -359,7 +357,7 @@ test_optional (struct argp *argp, int argc, char **argv, if (!val) { if (args->optional) - fail ("option processed incorrectly"); + fail ("option processed incorrectly"); } else if (strcmp (args->optional, val)) fail ("option processed incorrectly"); @@ -367,9 +365,9 @@ test_optional (struct argp *argp, int argc, char **argv, if (a) { if (index == argc) - fail ("expected command line argument not found"); + fail ("expected command line argument not found"); else if (strcmp (argv[index], a)) - fail ("expected command line argument does not match"); + fail ("expected command line argument does not match"); } }