tests/test-vasprintf.c: Test %08lx.
authorSimon Josefsson <simon@josefsson.org>
Wed, 21 Apr 2010 11:18:32 +0000 (13:18 +0200)
committerSimon Josefsson <simon@josefsson.org>
Wed, 21 Apr 2010 11:18:32 +0000 (13:18 +0200)
ChangeLog
tests/test-vasprintf.c

index ddc0d09..64948d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index e5dc3cd..e5676f4 100644 (file)
@@ -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