From 8d38373fd29b32f00bfb396705430a9022740fb5 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Fri, 31 May 2019 16:28:07 +0900 Subject: [PATCH] [KERNEL32_APITEST] Check CJK codepage before tests --- .../rostests/apitests/kernel32/ConsoleCP.c | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) 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); -- 2.17.1