X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-xvasprintf.c;h=aeeb3e5388ca92deb9142931246586784ac3881c;hb=50901279d8e42ea4bccc2eef0a6b11e7c3dde4cf;hp=cc70709876e413427f60d81556d019e7e28c87d1;hpb=21d7dbb8098b8e04661272f601a59ceb042ea934;p=gnulib.git diff --git a/tests/test-xvasprintf.c b/tests/test-xvasprintf.c index cc7070987..aeeb3e538 100644 --- a/tests/test-xvasprintf.c +++ b/tests/test-xvasprintf.c @@ -1,5 +1,5 @@ /* Test of xvasprintf() and xasprintf() functions. - Copyright (C) 2007-2009 Free Software Foundation, Inc. + Copyright (C) 2007-2011 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 @@ -21,23 +21,11 @@ #include "xvasprintf.h" #include -#include #include #include #include "progname.h" - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" static char * my_xasprintf (const char *format, ...) @@ -67,7 +55,7 @@ test_xvasprintf (void) { /* Silence gcc warning about zero-length format string. */ - char *empty = ""; + const char *empty = ""; result = my_xasprintf (empty); ASSERT (result != NULL); ASSERT (strcmp (result, "") == 0); @@ -91,7 +79,7 @@ test_xvasprintf (void) } static void -test_xasprintf () +test_xasprintf (void) { int repeat; char *result; @@ -106,7 +94,7 @@ test_xasprintf () { /* Silence gcc warning about zero-length format string. */ - char *empty = ""; + const char *empty = ""; result = xasprintf (empty); ASSERT (result != NULL); ASSERT (strcmp (result, "") == 0); @@ -130,7 +118,7 @@ test_xasprintf () } int -main (int argc _UNUSED_PARAMETER_, char *argv[]) +main (int argc _GL_UNUSED, char *argv[]) { set_program_name (argv[0]);