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

Alexandre Julliard julliard at winehq.org
Tue Apr 23 17:39:54 CDT 2019


Module: wine
Branch: master
Commit: a0e6d45519ff440a060311a865f32c7bfb3ad2a0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a0e6d45519ff440a060311a865f32c7bfb3ad2a0

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Tue Apr 23 22:01:33 2019 +0900

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

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/edit.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c
index 64d2fe8..3e0239c 100644
--- a/dlls/comctl32/tests/edit.c
+++ b/dlls/comctl32/tests/edit.c
@@ -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;




More information about the wine-cvs mailing list