From: Simon Josefsson Date: Wed, 21 Apr 2010 11:18:32 +0000 (+0200) Subject: tests/test-vasprintf.c: Test %08lx. X-Git-Tag: v0.1~4235 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=6d126a8f1bcb55344ff601decd524f53b54234fa;p=gnulib.git tests/test-vasprintf.c: Test %08lx. --- diff --git a/ChangeLog b/ChangeLog index ddc0d09aa..64948d704 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-04-21 Simon Josefsson + + * tests/test-vasprintf.c: Test %08lx. + 2010-04-20 Eric Blake tests: be robust to ignored SIGPIPE diff --git a/tests/test-vasprintf.c b/tests/test-vasprintf.c index e5dc3cd3d..e5676f4a9 100644 --- a/tests/test-vasprintf.c +++ b/tests/test-vasprintf.c @@ -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", 12345); + 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", 12345); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } } int