Module: wine Branch: master Commit: 525835897b9378ec736e60e6898a9c9ffd597ea2 URL: https://gitlab.winehq.org/wine/wine/-/commit/525835897b9378ec736e60e6898a9c9...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Feb 9 12:34:04 2024 +0100
gdi32/tests: Fix the expected GetTextMetrics() results on recent Windows.
---
dlls/gdi32/tests/font.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 76ea0ac7de7..0513c2b2ca8 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -6527,7 +6527,7 @@ static void test_max_height(void) DeleteObject(SelectObject(hdc, hfont_old));
/* test the largest value */ - lf.lfHeight = -((1 << 16) - 1); + lf.lfHeight = -((1 << 14) - 1); hfont = CreateFontIndirectA(&lf); hfont_old = SelectObject(hdc, hfont); memset(&tm, 0, sizeof(tm)); @@ -6547,12 +6547,15 @@ static void test_max_height(void) hfont_old = SelectObject(hdc, hfont); memset(&tm, 0, sizeof(tm)); r = GetTextMetricsA(hdc, &tm); - ok(r, "GetTextMetrics failed\n"); - ok(tm.tmHeight == tm1.tmHeight, - "expected 1 ppem value (%ld), got %ld\n", tm1.tmHeight, tm.tmHeight); - ok(tm.tmAveCharWidth == tm1.tmAveCharWidth, - "expected 1 ppem value (%ld), got %ld\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); - DeleteObject(SelectObject(hdc, hfont_old)); + if (r) + { + ok(r, "GetTextMetrics failed\n"); + ok(tm.tmHeight == tm1.tmHeight, + "expected 1 ppem value (%ld), got %ld\n", tm1.tmHeight, tm.tmHeight); + ok(tm.tmAveCharWidth == tm1.tmAveCharWidth, + "expected 1 ppem value (%ld), got %ld\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); + DeleteObject(SelectObject(hdc, hfont_old)); + } winetest_pop_context(); }