[PATCH] stop crash in font tests

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Jun 19 03:56:52 CDT 2008


---
 dlls/gdi32/tests/font.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 710148a..5061744 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1168,7 +1168,7 @@ static void test_font_charset(void)
 
     if (!pGetGlyphIndicesA || !pGetGlyphIndicesW)
     {
-        skip("Skipping the font charset test on a Win9x platform\n");
+        skip("Skipping the font charset test since GetGlyphIndices[A/W] are not avaialable\n");
         return;
     }
 
@@ -1317,7 +1317,8 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
     /* Observed behaviour: EnumFontFamilies enumerates aliases like "Arial Cyr"
      * while EnumFontFamiliesEx doesn't.
      */
-    if (!*font_name && font_charset == DEFAULT_CHARSET) /* do it only once */
+    /* EnumFontFamilies with the NULL parameter crashes win98 */
+    if (pGdiGetCharDimensions && !*font_name && font_charset == DEFAULT_CHARSET) /* do it only once */
     {
         efd.total = 0;
         SetLastError(0xdeadbeef);
@@ -1502,6 +1503,12 @@ static void test_negative_width(HDC hdc, const LOGFONTA *lf)
     LOGFONTA lf2 = *lf;
     WORD idx;
     MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} };
+    
+    if(!pGetGlyphIndicesA)
+    {
+        skip("GetGlyphIndicesA no available\n");
+        return;
+    }
 
     /* negative widths are handled just as positive ones */
     lf2.lfWidth = -lf->lfWidth;
-- 
1.5.4.1


--------------010506020509000108000307--




More information about the wine-patches mailing list