mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 16:43:38 +00:00
gdiplus/tests: Fix a font test crash when "MS Shell Dlg" is not found.
When "MS Shell Dlg" is missing GdipCreateFontFamilyFromName() leaves the GpFontFamily* pointer uninitialised. So initialize it to NULL in order to get clean failures instead of a crash. Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Signed-off-by: Esme Povirk <esme@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ad663360fa
commit
53371cc556
|
@ -883,8 +883,10 @@ static void test_font_substitution(void)
|
||||||
ok(lstrcmpA(lf.lfFaceName, "MS Shell Dlg") != 0, "expected substitution of MS Shell Dlg\n");
|
ok(lstrcmpA(lf.lfFaceName, "MS Shell Dlg") != 0, "expected substitution of MS Shell Dlg\n");
|
||||||
GdipDeleteFont(font);
|
GdipDeleteFont(font);
|
||||||
|
|
||||||
|
family = NULL;
|
||||||
status = GdipCreateFontFamilyFromName(L"MS Shell Dlg", NULL, &family);
|
status = GdipCreateFontFamilyFromName(L"MS Shell Dlg", NULL, &family);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
font = NULL;
|
||||||
status = GdipCreateFont(family, 12, FontStyleRegular, UnitPoint, &font);
|
status = GdipCreateFont(family, 12, FontStyleRegular, UnitPoint, &font);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
memset(&lf, 0xfe, sizeof(lf));
|
memset(&lf, 0xfe, sizeof(lf));
|
||||||
|
|
Loading…
Reference in a new issue