From: Katayama Hirofumi MZ Date: Fri, 31 May 2019 07:28:07 +0000 (+0900) Subject: [KERNEL32_APITEST] Check CJK codepage before tests X-Git-Tag: 0.4.14-dev~923 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=8d38373fd29b32f00bfb396705430a9022740fb5 [KERNEL32_APITEST] Check CJK codepage before tests --- diff --git a/modules/rostests/apitests/kernel32/ConsoleCP.c b/modules/rostests/apitests/kernel32/ConsoleCP.c index 5d12bd88c5c..5580fc189b6 100644 --- a/modules/rostests/apitests/kernel32/ConsoleCP.c +++ b/modules/rostests/apitests/kernel32/ConsoleCP.c @@ -24,6 +24,20 @@ static const WCHAR ideograph_space = (WCHAR)0x3000; /* fullwidth space */ LCID lcidJapanese = MAKELCID(MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT), SORT_DEFAULT); LCID lcidRussian = MAKELCID(MAKELANGID(LANG_RUSSIAN , SUBLANG_DEFAULT), SORT_DEFAULT); +static BOOL IsCJKCodePage(void) +{ + switch (GetOEMCP()) + { + case 936: // Chinese PRC + case 932: // Japanese + case 949: // Korean + case 1361: // Korean (Johab) + case 950: // Taiwan + return TRUE; + } + return FALSE; +} + /* Russian Code Page 855 */ // NOTE that CP 866 can also be used static void test_cp855(HANDLE hConOut) @@ -458,14 +472,28 @@ START_TEST(ConsoleCP) ok(hConOut != INVALID_HANDLE_VALUE, "Opening ConOut\n"); if (IsValidLocale(lcidRussian, LCID_INSTALLED)) - test_cp855(hConOut); + { + if (!IsCJKCodePage()) + test_cp855(hConOut); + else + skip("Russian testcase is skipped because of CJK\n"); + } else + { skip("Russian locale is not installed\n"); + } if (IsValidLocale(lcidJapanese, LCID_INSTALLED)) - test_cp932(hConOut); + { + if (IsCJKCodePage()) + test_cp932(hConOut); + else + skip("Japanese testcase is skipped because of not CJK\n"); + } else + { skip("Japanese locale is not installed\n"); + } CloseHandle(hConIn); CloseHandle(hConOut);