summaryrefslogtreecommitdiff
path: root/test/locale-mbwc/tst2_mbrtowc.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-24 20:22:12 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-24 20:22:12 +0200
commit7988979a722b4cdf287b2093956a76a3f19b9897 (patch)
treed35e251d0472ceca55a2eef61cff261c8ee68fab /test/locale-mbwc/tst2_mbrtowc.c
add uClibc-ng test directory
Diffstat (limited to 'test/locale-mbwc/tst2_mbrtowc.c')
-rw-r--r--test/locale-mbwc/tst2_mbrtowc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/locale-mbwc/tst2_mbrtowc.c b/test/locale-mbwc/tst2_mbrtowc.c
new file mode 100644
index 0000000..92e1283
--- /dev/null
+++ b/test/locale-mbwc/tst2_mbrtowc.c
@@ -0,0 +1,21 @@
+#include <wchar.h>
+#include <assert.h>
+#include <stdlib.h>
+
+/* bugs.uclibc.org/1471 : make sure output is 0 */
+static int
+do_test(void)
+{
+ wchar_t output;
+ int result;
+
+ output = L'A'; /* anything other than 0 will do... */
+ result = mbrtowc (&output, "", 1, 0);
+
+ assert (result == 0);
+ assert (output == 0);
+
+ return EXIT_SUCCESS;
+}
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"