[try2][Gdiplus] Skip the each generic font tests if we don't have the required fonts

Adam Petaccia adam at tpetaccia.com
Mon Aug 4 13:55:06 CDT 2008


Changelog:
(try2):
  Don't worry about using liberation fonts

On my Ubuntu 8.04 machine, msttcorefonts didn't include Microsoft Sans Serif,
   so its best to try the tests one by one rather than skipping over them all.
   This extra check doesn't invalidate the tests because Microsft Windows
   should NEVER return FontFamilyNotFound, and we're testing to see what the
   family actually is.
---
 dlls/gdiplus/tests/font.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index 8ce0ec6..bf0e62f 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -282,6 +282,11 @@ static void test_getgenerics (void)
     ZeroMemory(familyName, sizeof(familyName)/sizeof(WCHAR));
 
     stat = GdipGetGenericFontFamilySansSerif (&family);
+    if (stat == FontFamilyNotFound)
+    {
+        skip("Microsoft Sans Serif not installed\n");
+        goto serif;
+    }
     expect (Ok, stat);
     stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL);
     expect (Ok, stat);
@@ -292,7 +297,13 @@ static void test_getgenerics (void)
     stat = GdipDeleteFontFamily (family);
     expect (Ok, stat);
 
+serif:
     stat = GdipGetGenericFontFamilySerif (&family);
+    if (stat == FontFamilyNotFound)
+    {
+        skip("Times New Roman not installed\n");
+        goto monospace;
+    }
     expect (Ok, stat);
     stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL);
     expect (Ok, stat);
@@ -301,7 +312,13 @@ static void test_getgenerics (void)
     stat = GdipDeleteFontFamily (family);
     expect (Ok, stat);
 
+monospace:
     stat = GdipGetGenericFontFamilyMonospace (&family);
+    if (stat == FontFamilyNotFound)
+    {
+        skip("Courier New not installed\n");
+        return;
+    }
     expect (Ok, stat);
     stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL);
     expect (Ok, stat);
-- 
1.5.4.3




More information about the wine-patches mailing list