From 3108f3cf3d99aac1983cc5256afa87752899275e Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 29 May 2013 06:53:51 -0500 Subject: [PATCH] gdi32/tests: Do not try to test OS/2 win metrics on non-windows fonts. --- dlls/gdi32/tests/font.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index fdb6451a3eb..b57a6308e4c 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -3077,19 +3077,13 @@ static void test_text_metrics(const LOGFONT *lf, const NEWTEXTMETRIC *ntm) ret = GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size); ok(ret == size, "GetFontData should return %u not %u\n", size, ret); - ascent = GET_BE_WORD(tt_os2.usWinAscent); - descent = GET_BE_WORD(tt_os2.usWinDescent); - cell_height = ascent + descent; - ok(ntm->ntmCellHeight == cell_height, "%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n", - font_name, ntm->ntmCellHeight, cell_height, ascent, descent); - SetLastError(0xdeadbeef); ret = GetTextMetricsA(hdc, &tmA); ok(ret, "GetTextMetricsA error %u\n", GetLastError()); if(!get_first_last_from_cmap(hdc, &cmap_first, &cmap_last, &cmap_type)) { - skip("Unable to retrieve first and last glyphs from cmap\n"); + skip("%s is not a Windows font, OS/2 metrics may be invalid.\n",font_name); } else { @@ -3099,6 +3093,12 @@ static void test_text_metrics(const LOGFONT *lf, const NEWTEXTMETRIC *ntm) USHORT version; TEXTMETRICW tmW; + ascent = GET_BE_WORD(tt_os2.usWinAscent); + descent = GET_BE_WORD(tt_os2.usWinDescent); + cell_height = ascent + descent; + ok(ntm->ntmCellHeight == cell_height, "%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n", + font_name, ntm->ntmCellHeight, cell_height, ascent, descent); + version = GET_BE_WORD(tt_os2.version); os2_first_char = GET_BE_WORD(tt_os2.usFirstCharIndex); -- 2.11.4.GIT