Huw Davies : comctl32/tests: Skip some font dependent tests if we don' t have System or Tahoma installed.

Alexandre Julliard julliard at winehq.org
Tue Oct 9 13:37:38 CDT 2007


Module: wine
Branch: master
Commit: 75c2fb668d7e2a0729bf5ed5cbebea0133d0cec6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=75c2fb668d7e2a0729bf5ed5cbebea0133d0cec6

Author: Huw Davies <huw at codeweavers.com>
Date:   Sun Oct  7 12:16:46 2007 +0100

comctl32/tests: Skip some font dependent tests if we don't have System or Tahoma installed.

---

 dlls/comctl32/tests/rebar.c |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index d715d33..2b318d2 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -45,6 +45,23 @@ static HWND hRebar;
 
 #define expect_eq(expr, value, type, format) { type ret = expr; ok((value) == ret, #expr " expected " format "  got " format "\n", (value), (ret)); }
 
+static INT CALLBACK is_font_installed_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam)
+{
+    return 0;
+}
+
+static BOOL is_font_installed(const char *name)
+{
+    HDC hdc = GetDC(0);
+    BOOL ret = FALSE;
+
+    if(!EnumFontFamiliesA(hdc, name, is_font_installed_proc, 0))
+        ret = TRUE;
+
+    ReleaseDC(0, hdc);
+    return ret;
+}
+
 static void rebuild_rebar(HWND *hRebar)
 {
     if (*hRebar)
@@ -797,8 +814,14 @@ START_TEST(rebar)
     ShowWindow(hMainWnd, SW_SHOW);
 
     bandinfo_test();
-    layout_test();
-    resize_test();
+
+    if(is_font_installed("System") && is_font_installed("Tahoma"))
+    {
+        layout_test();
+        resize_test();
+    } else
+        skip("Missing System or Tahoma font\n");
+
     PostQuitMessage(0);
     while(GetMessageA(&msg,0,0,0)) {
         TranslateMessage(&msg);




More information about the wine-cvs mailing list