Module: wine Branch: master Commit: ec9166b1ac4bb3e3f2a2df1f82e95cfa14ddb272 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ec9166b1ac4bb3e3f2a2df1f82...
Author: Qian Hong fracting@gmail.com Date: Fri Oct 19 02:11:04 2012 +0800
gdi32/tests: Fixed broken bitmap font metrics test on CJK locales.
---
dlls/gdi32/tests/font.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 3961578..fef38e9 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -668,6 +668,12 @@ static INT CALLBACK find_font_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DW return 1; /* continue enumeration */ }
+static BOOL is_CJK(void) +{ + WORD system_lang_id = PRIMARYLANGID(GetSystemDefaultLangID()); + return (system_lang_id == LANG_CHINESE || system_lang_id == LANG_JAPANESE || system_lang_id == LANG_KOREAN); +} + #define FH_SCALE 0x80000000 static void test_bitmap_font_metrics(void) { @@ -933,7 +939,10 @@ static void test_bitmap_font_metrics(void)
SetLastError(0xdeadbeef); ret = GetTextCharset(hdc); - ok(ret == expected_cs, "got charset %d, expected %d\n", ret, expected_cs); + if (is_CJK() && lf.lfCharSet == ANSI_CHARSET) + ok(ret == ANSI_CHARSET, "got charset %d, expected ANSI_CHARSETd\n", ret); + else + ok(ret == expected_cs, "got charset %d, expected %d\n", ret, expected_cs);
trace("created %s, height %d charset %x dpi %d\n", face_name, tm.tmHeight, tm.tmCharSet, tm.tmDigitizedAspectX); trace("expected %s, height %d scaled_hight %d, dpi %d\n", fd[i].face_name, height, fd[i].scaled_height, fd[i].dpi);