From 6d126a8f1bcb55344ff601decd524f53b54234fa Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Wed, 21 Apr 2010 13:18:32 +0200 Subject: [PATCH] tests/test-vasprintf.c: Test %08lx. --- ChangeLog | 4 ++++ tests/test-vasprintf.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index ddc0d09aad..64948d704e 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 e5dc3cd3d3..e5676f4a9f 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 -- 2.30.2