commit 1136d831017b0b7052b45899d08093d8f4034ce8
parent b4b507633186e7f223231a60447d82a6e3ab92af
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 11 Mar 2025 14:25:06 +0100
tests/libc: Add 0038-mbsinit
Diffstat:
3 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/tests/libc/execute/.gitignore b/tests/libc/execute/.gitignore
@@ -35,4 +35,5 @@
0035-setlocale
0036-localeconv
0037-malloc
+0038-mbsinit
test.log
diff --git a/tests/libc/execute/0038-mbsinit.c b/tests/libc/execute/0038-mbsinit.c
@@ -0,0 +1,29 @@
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+/*
+output:
+testing
+done
+end:
+*/
+
+void
+tests_mbsinit(void)
+{
+ mbstate_t s;
+
+ assert(mbsinit(NULL) != 0);
+ assert(mbsinit(memset(&s, 0, sizeof(s))) != 0);
+}
+
+int
+main()
+{
+ puts("testing");
+ tests_mbsinit();
+ puts("done");
+ return 0;
+}
diff --git a/tests/libc/execute/libc-tests.lst b/tests/libc/execute/libc-tests.lst
@@ -34,3 +34,4 @@
0035-setlocale
0036-localeconv
0037-malloc [TODO]
+0038-mbsinit