wcrtomb: Enhance test.
authorBruno Haible <bruno@clisp.org>
Sun, 20 Feb 2011 13:08:44 +0000 (14:08 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 22 Feb 2011 12:12:49 +0000 (13:12 +0100)
* tests/test-wcrtomb.c (main): Add test against bug with NULL argument.

ChangeLog
tests/test-wcrtomb.c

index dbdc530..715ebcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-02-20  Bruno Haible  <bruno@clisp.org>
 
+       wcrtomb: Enhance test.
+       * tests/test-wcrtomb.c (main): Add test against bug with NULL argument.
+
+2011-02-20  Bruno Haible  <bruno@clisp.org>
+
        mbrtowc: Tiny optimization.
        * lib/mbrtowc.c (mbrtowc): Delay pstate assignment until it is needed.
 
index 48bae41..a50817f 100644 (file)
@@ -105,6 +105,14 @@ main (int argc, char *argv[])
         }
   }
 
+  /* Test special calling convention, passing a NULL pointer.  */
+  {
+    ret = wcrtomb (NULL, '\0', NULL);
+    ASSERT (ret == 1);
+    ret = wcrtomb (NULL, btowc ('x'), NULL);
+    ASSERT (ret == 1);
+  }
+
   if (argc > 1)
     switch (argv[1][0])
       {