gdi32: Fix a broken test.

This commit is contained in:
Dmitry Timoshkov 2008-11-06 15:10:17 +08:00 committed by Alexandre Julliard
parent 2d27d82909
commit 25a1803720
1 changed files with 14 additions and 7 deletions

View File

@ -1589,10 +1589,12 @@ static INT CALLBACK arial_enum_proc(const LOGFONT *lf, const TEXTMETRIC *tm, DWO
{ {
struct enum_font_data *efd = (struct enum_font_data *)lParam; struct enum_font_data *efd = (struct enum_font_data *)lParam;
ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight);
if (type != TRUETYPE_FONTTYPE) return 1; if (type != TRUETYPE_FONTTYPE) return 1;
#if 0 #if 0
trace("enumed font \"%s\", charset %d, weight %d, italic %d\n", trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
lf->lfFaceName, lf->lfCharSet, lf->lfWeight, lf->lfItalic); lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
#endif #endif
if (efd->total < MAX_ENUM_FONTS) if (efd->total < MAX_ENUM_FONTS)
efd->lf[efd->total++] = *lf; efd->lf[efd->total++] = *lf;
@ -1606,8 +1608,13 @@ static INT CALLBACK arial_enum_procw(const LOGFONTW *lf, const TEXTMETRICW *tm,
{ {
struct enum_font_dataW *efd = (struct enum_font_dataW *)lParam; struct enum_font_dataW *efd = (struct enum_font_dataW *)lParam;
if (type != TRUETYPE_FONTTYPE) return 1; ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight);
if (type != TRUETYPE_FONTTYPE) return 1;
#if 0
trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
#endif
if (efd->total < MAX_ENUM_FONTS) if (efd->total < MAX_ENUM_FONTS)
efd->lf[efd->total++] = *lf; efd->lf[efd->total++] = *lf;
else else
@ -1697,7 +1704,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
* Use EnumFontFamiliesW since win98 crashes when the * Use EnumFontFamiliesW since win98 crashes when the
* second parameter is NULL using EnumFontFamilies * second parameter is NULL using EnumFontFamilies
*/ */
efd.total = 0; efdw.total = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = EnumFontFamiliesW(hdc, NULL, arial_enum_procw, (LPARAM)&efdw); ret = EnumFontFamiliesW(hdc, NULL, arial_enum_procw, (LPARAM)&efdw);
ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesW error %u\n", GetLastError()); ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesW error %u\n", GetLastError());
@ -1706,13 +1713,13 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
get_charset_statsW(&efdw, &ansi_charset, &symbol_charset, &russian_charset); get_charset_statsW(&efdw, &ansi_charset, &symbol_charset, &russian_charset);
trace("enumerated ansi %d, symbol %d, russian %d fonts for NULL\n", trace("enumerated ansi %d, symbol %d, russian %d fonts for NULL\n",
ansi_charset, symbol_charset, russian_charset); ansi_charset, symbol_charset, russian_charset);
ok(efd.total == 0, "fonts enumerated: NULL\n"); ok(efdw.total > 0, "fonts enumerated: NULL\n");
ok(ansi_charset > 0, "NULL family should enumerate ANSI_CHARSET\n"); ok(ansi_charset > 0, "NULL family should enumerate ANSI_CHARSET\n");
ok(symbol_charset > 0, "NULL family should enumerate SYMBOL_CHARSET\n"); ok(symbol_charset > 0, "NULL family should enumerate SYMBOL_CHARSET\n");
ok(russian_charset > 0, "NULL family should enumerate RUSSIAN_CHARSET\n"); ok(russian_charset > 0, "NULL family should enumerate RUSSIAN_CHARSET\n");
} }
efd.total = 0; efdw.total = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = EnumFontFamiliesExW(hdc, NULL, arial_enum_procw, (LPARAM)&efdw, 0); ret = EnumFontFamiliesExW(hdc, NULL, arial_enum_procw, (LPARAM)&efdw, 0);
ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesExW error %u\n", GetLastError()); ok(ret || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED, "EnumFontFamiliesExW error %u\n", GetLastError());
@ -1721,7 +1728,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
get_charset_statsW(&efdw, &ansi_charset, &symbol_charset, &russian_charset); get_charset_statsW(&efdw, &ansi_charset, &symbol_charset, &russian_charset);
trace("enumerated ansi %d, symbol %d, russian %d fonts for NULL\n", trace("enumerated ansi %d, symbol %d, russian %d fonts for NULL\n",
ansi_charset, symbol_charset, russian_charset); ansi_charset, symbol_charset, russian_charset);
ok(efd.total == 0, "fonts enumerated: NULL\n"); ok(efdw.total > 0, "fonts enumerated: NULL\n");
ok(ansi_charset > 0, "NULL family should enumerate ANSI_CHARSET\n"); ok(ansi_charset > 0, "NULL family should enumerate ANSI_CHARSET\n");
ok(symbol_charset > 0, "NULL family should enumerate SYMBOL_CHARSET\n"); ok(symbol_charset > 0, "NULL family should enumerate SYMBOL_CHARSET\n");
ok(russian_charset > 0, "NULL family should enumerate RUSSIAN_CHARSET\n"); ok(russian_charset > 0, "NULL family should enumerate RUSSIAN_CHARSET\n");