tests/libc: Add a new invalid utf-8 test case - 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 8a18b4fd343760cf387e59ca9d27ffc2ef9b1ffa
(DIR) parent 94d009f0d25f0426186fe0f209abc1f229c47d12
(HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 08:21:50 +0100
tests/libc: Add a new invalid utf-8 test case
This test case test a overlong encoding for the character 'A'. While
we were testing overlong encodings, we were using some special cases
like the NUL character, and having a more normal ASCII case covers
some additional paths in the code.
Diffstat:
M tests/libc/execute/mbtest.h | 1 +
1 file changed, 1 insertion(+), 0 deletions(-)
---
(DIR) diff --git a/tests/libc/execute/mbtest.h b/tests/libc/execute/mbtest.h
@@ -38,6 +38,7 @@ static struct mbtest {
{"\x80", 2, -1, 1, EILSEQ, &wc, -1},
{"\xc0\x80", 2, -1, 1, EILSEQ, &wc, -1},
{"\xc0\x00", 2, -1, 1, EILSEQ, &wc, -1},
+ {"\xc1\x81", 2, -1, 1, EILSEQ, &wc, -1},
{"\xf8\x81\x82\x83\x84\x85", -1, -1, 1, EILSEQ, &wc, -1},
{"\xfe\x81\x82\x83\x84\x85\x86", 8, -1, 1, EILSEQ, &wc, -1},
};