usp10/tests: Catch case where enumerated font name is too long.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
This commit is contained in:
Aric Stewart 2015-09-25 10:11:26 -05:00 committed by Alexandre Julliard
parent 5b33f18cfc
commit 0072188b69
1 changed files with 10 additions and 0 deletions

View File

@ -1993,6 +1993,11 @@ static void test_ScriptGetFontProperties(HDC hdc)
for (i = 0; i < efnd.total; i++) for (i = 0; i < efnd.total; i++)
{ {
if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE)
{
trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName);
continue;
}
lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName);
font = CreateFontIndirectA(&lf); font = CreateFontIndirectA(&lf);
oldfont = SelectObject(hdc, font); oldfont = SelectObject(hdc, font);
@ -2034,6 +2039,11 @@ static void test_ScriptGetFontProperties(HDC hdc)
for (i = 0; i < efnd.total; i++) for (i = 0; i < efnd.total; i++)
{ {
if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE)
{
trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName);
continue;
}
lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName);
font = CreateFontIndirectA(&lf); font = CreateFontIndirectA(&lf);
oldfont = SelectObject(hdc, font); oldfont = SelectObject(hdc, font);