diff options
| author | jvoisin | 2023-08-21 22:49:21 +0200 |
|---|---|---|
| committer | jvoisin | 2023-08-21 22:49:21 +0200 |
| commit | bc0c8a57cb13fb110b3f9e050d67ef2d5678f85f (patch) | |
| tree | 3ede82e4529428559a96a2092123dc58baee23a7 /tests/test_mbstowcs_static.c | |
| parent | cceaaa8161eb8b0b39854215417b39a9703b7aa5 (diff) | |
Add tests for mbstowcs
Diffstat (limited to 'tests/test_mbstowcs_static.c')
| -rw-r--r-- | tests/test_mbstowcs_static.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_mbstowcs_static.c b/tests/test_mbstowcs_static.c new file mode 100644 index 0000000..8dbdfa1 --- /dev/null +++ b/tests/test_mbstowcs_static.c | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <wchar.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | const char* mbstr = "z\u00df\u6c34\U0001f34c"; // or u8"zß水🍌" | ||
| 7 | wchar_t wstr[5]; | ||
| 8 | mbstowcs(wstr, mbstr, 4); | ||
| 9 | |||
| 10 | CHK_FAIL_START | ||
| 11 | mbstowcs(wstr, mbstr, 16); | ||
| 12 | CHK_FAIL_END | ||
| 13 | |||
| 14 | return ret; | ||
| 15 | } | ||
