Mercurial > hg > octave-lojdl > gnulib-hg
comparison tests/test-wcrtomb.c @ 14375:5c0504048541
wcrtomb: Enhance test.
* tests/test-wcrtomb.c (main): Add test against bug with NULL argument.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 20 Feb 2011 14:08:44 +0100 |
parents | 97fc9a21a8fb |
children | 8250f2777afc |
comparison
equal
deleted
inserted
replaced
14374:85a5ffbc0cb3 | 14375:5c0504048541 |
---|---|
103 ASSERT (buf[0] == (char) c); | 103 ASSERT (buf[0] == (char) c); |
104 break; | 104 break; |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 /* Test special calling convention, passing a NULL pointer. */ | |
109 { | |
110 ret = wcrtomb (NULL, '\0', NULL); | |
111 ASSERT (ret == 1); | |
112 ret = wcrtomb (NULL, btowc ('x'), NULL); | |
113 ASSERT (ret == 1); | |
114 } | |
115 | |
108 if (argc > 1) | 116 if (argc > 1) |
109 switch (argv[1][0]) | 117 switch (argv[1][0]) |
110 { | 118 { |
111 case '1': | 119 case '1': |
112 /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ | 120 /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ |