Commit 5f25d7a9 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

gdiplus/tests: Add some font family pointer tests.

parent b1dbe76d
...@@ -141,6 +141,8 @@ static void test_createfont(void) ...@@ -141,6 +141,8 @@ static void test_createfont(void)
expect(Ok, stat); expect(Ok, stat);
stat = GdipGetFamilyName(fontfamily2, familyname, 0); stat = GdipGetFamilyName(fontfamily2, familyname, 0);
expect(Ok, stat); expect(Ok, stat);
todo_wine
ok (fontfamily == fontfamily2, "Unexpected family instance.\n");
ok (lstrcmpiW(Tahoma, familyname) == 0, "Expected Tahoma, got %s\n", ok (lstrcmpiW(Tahoma, familyname) == 0, "Expected Tahoma, got %s\n",
wine_dbgstr_w(familyname)); wine_dbgstr_w(familyname));
stat = GdipDeleteFontFamily(fontfamily2); stat = GdipDeleteFontFamily(fontfamily2);
...@@ -343,6 +345,8 @@ static void test_fontfamily (void) ...@@ -343,6 +345,8 @@ static void test_fontfamily (void)
ZeroMemory (itsName, sizeof(itsName)); ZeroMemory (itsName, sizeof(itsName));
stat = GdipCloneFontFamily(family, &clonedFontFamily); stat = GdipCloneFontFamily(family, &clonedFontFamily);
expect (Ok, stat); expect (Ok, stat);
todo_wine
ok (family == clonedFontFamily, "Unexpected family instance.\n");
GdipDeleteFontFamily(family); GdipDeleteFontFamily(family);
stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL); stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL);
expect(Ok, stat); expect(Ok, stat);
...@@ -1187,8 +1191,9 @@ todo_wine ...@@ -1187,8 +1191,9 @@ todo_wine
static void test_GdipGetFontCollectionFamilyList(void) static void test_GdipGetFontCollectionFamilyList(void)
{ {
GpFontFamily *family, *family2; GpFontFamily *family, *family2, **families;
GpFontCollection *collection; GpFontCollection *collection;
UINT i;
INT found, count; INT found, count;
GpStatus status; GpStatus status;
...@@ -1228,15 +1233,32 @@ static void test_GdipGetFontCollectionFamilyList(void) ...@@ -1228,15 +1233,32 @@ static void test_GdipGetFontCollectionFamilyList(void)
ok(found == 1, "Unexpected list count %d.\n", found); ok(found == 1, "Unexpected list count %d.\n", found);
ok(family != NULL, "Expected family instance.\n"); ok(family != NULL, "Expected family instance.\n");
family = NULL; family2 = NULL;
found = 0; found = 0;
status = GdipGetFontCollectionFamilyList(collection, 1, &family2, &found); status = GdipGetFontCollectionFamilyList(collection, 1, &family2, &found);
ok(status == Ok, "Failed to get family list, status %d.\n", status); ok(status == Ok, "Failed to get family list, status %d.\n", status);
ok(found == 1, "Unexpected list count %d.\n", found); 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); status = GdipDeleteFontFamily(family);
GdipDeleteFontFamily(family2); 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) static void test_GdipGetFontCollectionFamilyCount(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment