[KERNEL32_APITEST] 5-byte, 6-byte, ... UTF-8 sequences

This commit is contained in:
Katayama Hirofumi MZ 2019-04-06 17:48:15 +09:00
parent 7cb02f432f
commit 89af984b16

View file

@ -111,6 +111,40 @@ static const ENTRY Entries[] =
/* Japanese CP932 truncated source */
{ __LINE__, 1, 0xBEAF, CP932, 0, SJIS_Japanese, 1, 4, {0x30FB, 0x7F7F}, 2 },
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, 1, 4, {0x7F7F, 0x7F7F}, 2 },
/* invalid 5-byte UTF-8 sequences */
{ __LINE__, 1, 48815, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 1, 4, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 2, 48815, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 2, 4, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
{ __LINE__, 3, 48815, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 3, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
{ __LINE__, 4, 48815, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 4, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
{ __LINE__, 5, 48815, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 5, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 6, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
/* invalid 6-byte UTF-8 sequences */
{ __LINE__, 1, 48815, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 1, 4, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 2, 48815, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 2, 4, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
{ __LINE__, 3, 48815, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 3, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
{ __LINE__, 4, 48815, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 4, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
{ __LINE__, 5, 48815, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 5, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 6, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 7, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
/* invalid 7-byte UTF-8 sequences */
{ __LINE__, 1, 48815, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 1, 4, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 2, 48815, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 2, 4, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
{ __LINE__, 3, 48815, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 3, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
{ __LINE__, 4, 48815, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 4, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
{ __LINE__, 5, 48815, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 5, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 6, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 7, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 8, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
/* invalid UTF-8 sequences */
{ __LINE__, 1, 48815, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 1, 4, {0xFFFD, 0x7F7F}, 2 },
{ __LINE__, 2, 48815, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 2, 4, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
{ __LINE__, 3, 48815, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 3, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
{ __LINE__, 4, 48815, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 4, 4, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
{ __LINE__, 5, 48815, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 5, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 6, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 7, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 8, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3", 9, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
};
static void TestEntry(const ENTRY *pEntry)