changeset 13252:4a27549ddb0e

tests/test-vasprintf.c: Test %08lx.
author Simon Josefsson <simon@josefsson.org>
date Wed, 21 Apr 2010 13:18:32 +0200
parents 700012efeb01
children 51e653bb55dd
files ChangeLog tests/test-vasprintf.c
diffstat 2 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Apr 20 09:34:04 2010 -0600
+++ b/ChangeLog	Wed Apr 21 13:18:32 2010 +0200
@@ -1,3 +1,7 @@
+2010-04-21  Simon Josefsson  <simon@josefsson.org>
+
+	* tests/test-vasprintf.c: Test %08lx.
+
 2010-04-20  Eric Blake  <eblake@redhat.com>
 
 	tests: be robust to ignored SIGPIPE
--- a/tests/test-vasprintf.c	Tue Apr 20 09:34:04 2010 -0600
+++ b/tests/test-vasprintf.c	Wed Apr 21 13:18:32 2010 +0200
@@ -56,6 +56,16 @@
       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 @@
       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