tests/libc: Add 0038-mbsinit - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 1136d831017b0b7052b45899d08093d8f4034ce8
 (DIR) parent b4b507633186e7f223231a60447d82a6e3ab92af
 (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
       Date:   Tue, 11 Mar 2025 14:25:06 +0100
       
       tests/libc: Add 0038-mbsinit
       
       Diffstat:
         M tests/libc/execute/.gitignore       |       1 +
         A tests/libc/execute/0038-mbsinit.c   |      29 +++++++++++++++++++++++++++++
         M tests/libc/execute/libc-tests.lst   |       1 +
       
       3 files changed, 31 insertions(+), 0 deletions(-)
       ---
 (DIR) 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
 (DIR) 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;
       +}
 (DIR) 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