From efb8afcfdcda88c8664641495e2adb05ca9a3319 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 10 Sep 2015 14:47:11 +0300 Subject: [PATCH] gdi32/tests: Avoid excessive traces for fonts with OS/2 version 4 tables. --- dlls/gdi32/tests/font.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 6b0da1f40d2..cdc77261458 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -3188,9 +3188,14 @@ typedef struct USHORT usDefaultChar; USHORT usBreakChar; USHORT usMaxContext; -} TT_OS2_V2; + /* version 4 (OpenType 1.6) */ + USHORT usLowerOpticalPointSize; + USHORT usUpperOpticalPointSize; +} TT_OS2_V4; #include "poppack.h" +#define TT_OS2_V0_SIZE (FIELD_OFFSET(TT_OS2_V4, ulCodePageRange1)) + typedef struct { USHORT version; @@ -3242,7 +3247,7 @@ typedef struct USHORT id_range_offset; } cmap_format_4_seg; -static void expect_ff(const TEXTMETRICA *tmA, const TT_OS2_V2 *os2, WORD family, const char *name) +static void expect_ff(const TEXTMETRICA *tmA, const TT_OS2_V4 *os2, WORD family, const char *name) { ok((tmA->tmPitchAndFamily & 0xf0) == family || broken(PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH), @@ -3662,7 +3667,7 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) HDC hdc; HFONT hfont, hfont_old; TEXTMETRICA tmA; - TT_OS2_V2 tt_os2; + TT_OS2_V4 tt_os2; LONG size, ret; const char *font_name = lf->lfFaceName; DWORD cmap_first = 0, cmap_last = 0; @@ -3693,7 +3698,8 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) memset(&tt_os2, 0, sizeof(tt_os2)); ret = GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size); - ok(ret == size, "GetFontData should return %u not %u\n", size, ret); + ok(ret >= TT_OS2_V0_SIZE && ret <= size, "GetFontData should return size from [%u,%u] not %u\n", TT_OS2_V0_SIZE, + size, ret); SetLastError(0xdeadbeef); ret = GetTextMetricsA(hdc, &tmA);