Commit 5aa90f37 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdiplus: Skip some tests if certain fonts are not installed.

parent bf89330d
...@@ -53,6 +53,11 @@ static void test_createfont(void) ...@@ -53,6 +53,11 @@ static void test_createfont(void)
stat = GdipDeleteFont(font); stat = GdipDeleteFont(font);
expect (InvalidParameter, stat); expect (InvalidParameter, stat);
stat = GdipCreateFontFamilyFromName(arial, NULL, &fontfamily); stat = GdipCreateFontFamilyFromName(arial, NULL, &fontfamily);
if(stat == FontFamilyNotFound)
{
skip("Arial not installed\n");
return;
}
expect (Ok, stat); expect (Ok, stat);
stat = GdipCreateFont(fontfamily, 12, FontStyleRegular, UnitPoint, &font); stat = GdipCreateFont(fontfamily, 12, FontStyleRegular, UnitPoint, &font);
expect (Ok, stat); expect (Ok, stat);
...@@ -174,6 +179,11 @@ todo_wine ...@@ -174,6 +179,11 @@ todo_wine
} }
stat = GdipCreateFontFamilyFromName (arial, NULL, &family); stat = GdipCreateFontFamilyFromName (arial, NULL, &family);
if(stat == FontFamilyNotFound)
{
skip("Arial not installed\n");
return;
}
expect (Ok, stat); expect (Ok, stat);
stat = GdipGetFamilyName (family, itsName, LANG_NEUTRAL); stat = GdipGetFamilyName (family, itsName, LANG_NEUTRAL);
...@@ -205,46 +215,56 @@ static void test_fontfamily_properties (void) ...@@ -205,46 +215,56 @@ static void test_fontfamily_properties (void)
GpStatus stat; GpStatus stat;
UINT16 result = 0; UINT16 result = 0;
GdipCreateFontFamilyFromName(arial, NULL, &FontFamily); stat = GdipCreateFontFamilyFromName(arial, NULL, &FontFamily);
if(stat == FontFamilyNotFound)
skip("Arial not installed\n");
else
{
todo_wine todo_wine
{ {
stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result); stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result);
expect(Ok, stat); expect(Ok, stat);
ok (result == 2355, "Expected 2355, got %d\n", result); ok (result == 2355, "Expected 2355, got %d\n", result);
} }
result = 0; result = 0;
stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result); stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result);
expect(Ok, stat); expect(Ok, stat);
ok(result == 2048, "Expected 2048, got %d\n", result); ok(result == 2048, "Expected 2048, got %d\n", result);
result = 0; result = 0;
stat = GdipGetCellAscent(FontFamily, FontStyleRegular, &result); stat = GdipGetCellAscent(FontFamily, FontStyleRegular, &result);
expect(Ok, stat); expect(Ok, stat);
ok(result == 1854, "Expected 1854, got %d\n", result); ok(result == 1854, "Expected 1854, got %d\n", result);
result = 0; result = 0;
stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result); stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result);
ok(result == 434, "Expected 434, got %d\n", result); ok(result == 434, "Expected 434, got %d\n", result);
GdipDeleteFontFamily(FontFamily); GdipDeleteFontFamily(FontFamily);
}
GdipCreateFontFamilyFromName(TimesNewRoman, NULL, &FontFamily);
result = 0; stat = GdipCreateFontFamilyFromName(TimesNewRoman, NULL, &FontFamily);
if(stat == FontFamilyNotFound)
skip("Times New Roman not installed\n");
else
{
result = 0;
todo_wine todo_wine
{ {
stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result); stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result);
expect(Ok, stat); expect(Ok, stat);
ok(result == 2355, "Expected 2355, got %d\n", result); ok(result == 2355, "Expected 2355, got %d\n", result);
} }
result = 0; result = 0;
stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result); stat = GdipGetEmHeight(FontFamily, FontStyleRegular, &result);
expect(Ok, stat); expect(Ok, stat);
ok(result == 2048, "Expected 2048, got %d\n", result); ok(result == 2048, "Expected 2048, got %d\n", result);
result = 0; result = 0;
stat = GdipGetCellAscent(FontFamily, FontStyleRegular, &result); stat = GdipGetCellAscent(FontFamily, FontStyleRegular, &result);
expect(Ok, stat); expect(Ok, stat);
ok(result == 1825, "Expected 1825, got %d\n", result); ok(result == 1825, "Expected 1825, got %d\n", result);
result = 0; result = 0;
stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result); stat = GdipGetCellDescent(FontFamily, FontStyleRegular, &result);
ok(result == 443, "Expected 443 got %d\n", result); ok(result == 443, "Expected 443 got %d\n", result);
GdipDeleteFontFamily(FontFamily); GdipDeleteFontFamily(FontFamily);
}
} }
static void test_getgenerics (void) static void test_getgenerics (void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment