gdiplus: test_fontfamily: Don't use a pointer-to-pointer construct.
This commit is contained in:
parent
7e245060ef
commit
45ee7577c4
|
@ -150,49 +150,37 @@ static void test_logfont(void)
|
||||||
|
|
||||||
static void test_fontfamily (void)
|
static void test_fontfamily (void)
|
||||||
{
|
{
|
||||||
GpFontFamily** family = NULL;
|
GpFontFamily* family;
|
||||||
WCHAR itsName[LF_FACESIZE];
|
WCHAR itsName[LF_FACESIZE];
|
||||||
GpStatus stat;
|
GpStatus stat;
|
||||||
|
|
||||||
/* FontFamily can not be NULL */
|
/* FontFamily can not be NULL */
|
||||||
stat = GdipCreateFontFamilyFromName (arial , NULL, family);
|
stat = GdipCreateFontFamilyFromName (arial , NULL, NULL);
|
||||||
expect (InvalidParameter, stat);
|
expect (InvalidParameter, stat);
|
||||||
|
|
||||||
family = GdipAlloc (sizeof (GpFontFamily*));
|
|
||||||
|
|
||||||
/* FontFamily must be able to actually find the family.
|
/* FontFamily must be able to actually find the family.
|
||||||
* If it can't, any subsequent calls should fail
|
* If it can't, any subsequent calls should fail.
|
||||||
*
|
|
||||||
* We currently fail (meaning we don't) because we don't actually
|
|
||||||
* test to see if we can successfully get a family
|
|
||||||
*/
|
*/
|
||||||
stat = GdipCreateFontFamilyFromName (nonexistant, NULL, family);
|
stat = GdipCreateFontFamilyFromName (nonexistant, NULL, &family);
|
||||||
expect (FontFamilyNotFound, stat);
|
expect (FontFamilyNotFound, stat);
|
||||||
stat = GdipGetFamilyName (*family,itsName, LANG_NEUTRAL);
|
ok ((lstrcmpiW(itsName, nonexistant) != 0),
|
||||||
expect (InvalidParameter, stat);
|
|
||||||
ok ((lstrcmpiW(itsName,nonexistant) != 0),
|
|
||||||
"Expected a non-zero value for nonexistant font!\n");
|
"Expected a non-zero value for nonexistant font!\n");
|
||||||
stat = GdipDeleteFontFamily(*family);
|
|
||||||
expect (InvalidParameter, stat);
|
|
||||||
|
|
||||||
stat = GdipCreateFontFamilyFromName (arial, NULL, family);
|
stat = GdipCreateFontFamilyFromName (arial, NULL, &family);
|
||||||
expect (Ok, stat);
|
expect (Ok, stat);
|
||||||
|
|
||||||
stat = GdipGetFamilyName (*family, itsName, LANG_NEUTRAL);
|
stat = GdipGetFamilyName (family, itsName, LANG_NEUTRAL);
|
||||||
expect (Ok, stat);
|
expect (Ok, stat);
|
||||||
expect (0, lstrcmpiW(itsName,arial));
|
expect (0, lstrcmpiW(itsName, arial));
|
||||||
|
|
||||||
if (0)
|
if (0)
|
||||||
{
|
{
|
||||||
/* Crashes on Windows XP SP2, Vista, and so Wine as well */
|
/* Crashes on Windows XP SP2, Vista, and so Wine as well */
|
||||||
stat = GdipGetFamilyName (*family, NULL, LANG_NEUTRAL);
|
stat = GdipGetFamilyName (family, NULL, LANG_NEUTRAL);
|
||||||
expect (Ok, stat);
|
expect (Ok, stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
stat = GdipDeleteFontFamily(*family);
|
GdipDeleteFontFamily(family);
|
||||||
expect (Ok, stat);
|
|
||||||
|
|
||||||
GdipFree (family);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue