X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-vasprintf.c;h=6882d18d62fcaa29a838852216b16c26938ba137;hb=94122ae4818e7808c99303a0d2094ee9c6a2b843;hp=e5dc3cd3d33d60e616bc05af683334beb9a13039;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/tests/test-vasprintf.c b/tests/test-vasprintf.c index e5dc3cd3d..6882d18d6 100644 --- a/tests/test-vasprintf.c +++ b/tests/test-vasprintf.c @@ -1,5 +1,5 @@ /* Test of vasprintf() and asprintf() functions. - Copyright (C) 2007-2010 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 @@ -56,6 +56,16 @@ test_vasprintf () ASSERT (strcmp (result, "12345") == 0); free (result); } + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = my_asprintf (&result, "%08lx", 12345UL); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } } static void @@ -72,6 +82,16 @@ test_asprintf () ASSERT (strcmp (result, "12345") == 0); free (result); } + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = asprintf (&result, "%08lx", 12345UL); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } } int