comctl32/tests: Skip margin tests if a font for the target charset isn't available.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Akihiro Sagawa 2019-04-23 22:01:33 +09:00 committed by Alexandre Julliard
parent 48d86f8931
commit a0e6d45519
1 changed files with 11 additions and 1 deletions

View File

@ -1490,6 +1490,7 @@ static void test_margins_usefontinfo(UINT charset)
INT margins, threshold, expect, empty_expect, small_expect;
HWND hwnd;
HDC hdc;
TEXTMETRICW tm;
SIZE size;
BOOL cjk;
LOGFONTA lf;
@ -1513,7 +1514,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;