Akihiro Sagawa : user32/tests: Skip margin tests if a font for the target charset isn't available.
Alexandre Julliard
julliard at winehq.org
Mon Mar 18 16:20:16 CDT 2019
Module: wine
Branch: master
Commit: bde955f12b0bfeec767825737093a06b54a0a3aa
URL: https://source.winehq.org/git/wine.git/?a=commit;h=bde955f12b0bfeec767825737093a06b54a0a3aa
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Thu Mar 14 23:55:19 2019 +0900
user32/tests: Skip margin tests if a font for the target charset isn't available.
Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/tests/edit.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index 00c05fd..326d7ec 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -1439,6 +1439,7 @@ static void test_margins_usefontinfo(UINT charset)
{
HWND hwnd;
HDC hdc;
+ TEXTMETRICW tm;
SIZE size;
BOOL cjk = FALSE;
LOGFONTA lf;
@@ -1463,7 +1464,16 @@ static void test_margins_usefontinfo(UINT charset)
hdc = GetDC(hwnd);
hfont = SelectObject(hdc, hfont);
- size.cx = GdiGetCharDimensions( hdc, NULL, &size.cy );
+ size.cx = GdiGetCharDimensions( hdc, &tm, &size.cy );
+ if ((charset != tm.tmCharSet && charset != DEFAULT_CHARSET) ||
+ !(tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR))) {
+ skip("%s for charset %d isn't available\n", lf.lfFaceName, charset);
+ hfont = SelectObject(hdc, hfont);
+ ReleaseDC(hwnd, hdc);
+ DestroyWindow(hwnd);
+ DeleteObject(hfont);
+ return;
+ }
expect = MAKELONG(size.cx / 2, size.cx / 2);
small_expect = 0;
empty_expect = size.cx >= 28 ? small_expect : expect;
More information about the wine-cvs
mailing list