gdiplus/tests: Add some font family pointer tests.

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2019-01-26 15:23:04 +01:00 committed by Alexandre Julliard
parent b1dbe76d7a
commit 5f25d7a9a9
1 changed files with 27 additions and 5 deletions

View File

@ -141,6 +141,8 @@ static void test_createfont(void)
expect(Ok, stat);
stat = GdipGetFamilyName(fontfamily2, familyname, 0);
expect(Ok, stat);
todo_wine
ok (fontfamily == fontfamily2, "Unexpected family instance.\n");
ok (lstrcmpiW(Tahoma, familyname) == 0, "Expected Tahoma, got %s\n",
wine_dbgstr_w(familyname));
stat = GdipDeleteFontFamily(fontfamily2);
@ -343,6 +345,8 @@ static void test_fontfamily (void)
ZeroMemory (itsName, sizeof(itsName));
stat = GdipCloneFontFamily(family, &clonedFontFamily);
expect (Ok, stat);
todo_wine
ok (family == clonedFontFamily, "Unexpected family instance.\n");
GdipDeleteFontFamily(family);
stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL);
expect(Ok, stat);
@ -1187,8 +1191,9 @@ todo_wine
static void test_GdipGetFontCollectionFamilyList(void)
{
GpFontFamily *family, *family2;
GpFontFamily *family, *family2, **families;
GpFontCollection *collection;
UINT i;
INT found, count;
GpStatus status;
@ -1228,15 +1233,32 @@ static void test_GdipGetFontCollectionFamilyList(void)
ok(found == 1, "Unexpected list count %d.\n", found);
ok(family != NULL, "Expected family instance.\n");
family = NULL;
family2 = NULL;
found = 0;
status = GdipGetFontCollectionFamilyList(collection, 1, &family2, &found);
ok(status == Ok, "Failed to get family list, status %d.\n", status);
ok(found == 1, "Unexpected list count %d.\n", found);
ok(family2 != family, "Unexpected family instance.\n");
todo_wine
ok(family2 == family, "Unexpected family instance.\n");
GdipDeleteFontFamily(family);
GdipDeleteFontFamily(family2);
status = GdipDeleteFontFamily(family);
expect(Ok, status);
status = GdipDeleteFontFamily(family2);
expect(Ok, status);
families = GdipAlloc((count + 1) * sizeof(*families));
found = 0;
status = GdipGetFontCollectionFamilyList(collection, count + 1, families, &found);
ok(status == Ok, "Failed to get family list, status %d.\n", status);
ok(found == count, "Unexpected list count %d, extected %d.\n", found, count);
for (i = 0; i < found; i++)
{
status = GdipDeleteFontFamily(families[i]);
expect(Ok, status);
}
GdipFree(families);
}
static void test_GdipGetFontCollectionFamilyCount(void)