X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-argv-iter.c;h=19680cf491206d4eb265c117a68b2f93027df90c;hb=bbfcd2f1a92c9bdbb8d7d7d0a8a8c6665c316747;hp=7682c4a02af20704c82d4fea804a80366fac13a5;hpb=675fbd30d44edd7ecfca9e9013424b187eb3db70;p=gnulib.git diff --git a/tests/test-argv-iter.c b/tests/test-argv-iter.c index 7682c4a02..19680cf49 100644 --- a/tests/test-argv-iter.c +++ b/tests/test-argv-iter.c @@ -1,5 +1,5 @@ /* Test argv iterator - Copyright (C) 2008-2009 Free Software Foundation, Inc. + Copyright (C) 2008-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,25 +17,16 @@ /* Written by Jim Meyering. */ #include -#include + +#include "argv-iter.h" + #include #include -#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) -#define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" -#include "argv-iter.h" +#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) +#define STREQ(a, b) (strcmp (a, b) == 0) static FILE * write_nul_delimited_argv (char **argv) @@ -54,14 +45,17 @@ write_nul_delimited_argv (char **argv) } int -main () +main (void) { /* set_program_name (argv[0]); placate overzealous "syntax-check" test. */ + static char one[] = "1"; + static char two[] = "2"; + static char three[] = "3"; static char *av[][4] = { {NULL}, - {"1", NULL}, - {"1", "2", NULL}, - {"1", "2", "3", NULL} + {one, NULL}, + {one, two, NULL}, + {one, two, three, NULL} }; int use_stream;