user32/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>
This commit is contained in:
Akihiro Sagawa 2019-03-14 23:55:19 +09:00 committed by Alexandre Julliard
parent be6a113190
commit bde955f12b
1 changed files with 11 additions and 1 deletions

View File

@ -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;