https://git.reactos.org/?p=reactos.git;a=commitdiff;h=009dafe3915b58ad238f6…
commit 009dafe3915b58ad238f6110f9f558a2db1a93da
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Nov 1 09:06:34 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Nov 1 09:06:34 2019 +0900
[KERNEL32_APITEST] Strengthen MultiByteToWideChar(CP_UTF8, ...) testcase (#2008)
CORE-16468
---
modules/rostests/apitests/kernel32/MultiByteToWideChar.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/modules/rostests/apitests/kernel32/MultiByteToWideChar.c
b/modules/rostests/apitests/kernel32/MultiByteToWideChar.c
index e5213d3fc18..0b59040ba65 100644
--- a/modules/rostests/apitests/kernel32/MultiByteToWideChar.c
+++ b/modules/rostests/apitests/kernel32/MultiByteToWideChar.c
@@ -65,28 +65,40 @@ static const ENTRY Entries[] =
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4 },
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3 },
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4 },
+ { __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1 },
+ { __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xC0", 2 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xC0\xC0\x80", 4 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xE0\xC0", 3 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xE0\x20\xC0", 4 },
+ { __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\x82\xA0\x82\xA2", -1 },
+ { __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\x82\xA0\x82\xA2\x82", -1 },
/* invalid UTF-8 sequences with buffer */
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xC0", 2, 4, {0xFFFD, 0, 0x7F7F}, 3},
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4, 5, {0xFFFD, 0xFFFD,
0xFFFD, 0, 0x7F7F}, 5 },
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3, 4, {0xFFFD, 0xFFFD, 0,
0x7F7F}, 4 },
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4, 5, {0xFFFD, 0x0020,
0xFFFD, 0, 0x7F7F}, 5 },
+ { __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 5, {0xFFFD,
0xFFFD, 0xFFFD, 0xFFFD, 0}, 5 },
+ { __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 8, {0xFFFD,
0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 6 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xC0", 2, 4, {0xFFFD, 0, 0x7F7F}, 3 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xC0\xC0\x80", 4, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 5 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xE0\xC0", 3, 4, {0xFFFD, 0xFFFD, 0, 0x7F7F}, 4 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xE0\x20\xC0", 4, 5, {0xFFFD, 0x0020, 0xFFFD, 0, 0x7F7F}, 5 },
+ { __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\x82\xA0\x82\xA2", -1, 6, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 6 },
+ { __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS,
"\x82\xA0\x82\xA2\x82", -1, 7, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0,
0x7F7F}, 7 },
/* invalid UTF-8 sequences with short buffer */
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xC0", 2, 1,
{0xFFFD, 0x7F7F}, 2},
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xC0\xC0\x80", 4, 1,
{0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\xC0", 3, 1,
{0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\x20\xC0", 4, 1,
{0xFFFD, 0x7F7F}, 2 },
+ { __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\x82\xA0\x82\xA2",
-1, 1, {0xFFFD, 0x7F7F}, 2 },
+ { __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0,
"\x82\xA0\x82\xA2\x82", -1, 1, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xC0", 2, 1, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xC0\xC0\x80", 4, 1, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xE0\xC0", 3, 1, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS,
"\xE0\x20\xC0", 4, 1, {0xFFFD, 0x7F7F}, 2 },
+ { __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS,
"\x82\xA0\x82\xA2", -1, 1, {0xFFFD, 0x7F7F}, 2 },
+ { __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS,
"\x82\xA0\x82\xA2\x82", -1, 1, {0xFFFD, 0x7F7F}, 2 },
/* Japanese UTF-8 without buffer */
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese) },
{ __LINE__, 4, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese,
sizeof(UTF8_Japanese) },