Commit 4616954a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus/tests: Some tests for GdipGetFontCollectionFamilyList() and system collection.

parent b8d01f9e
......@@ -1110,6 +1110,60 @@ todo_wine
DeleteDC(hdc);
}
static void test_GdipGetFontCollectionFamilyList(void)
{
GpFontFamily *family, *family2;
GpFontCollection *collection;
INT found, count;
GpStatus status;
status = GdipNewInstalledFontCollection(&collection);
ok(status == Ok, "Failed to get system collection, status %d.\n", status);
count = 0;
status = GdipGetFontCollectionFamilyCount(collection, &count);
ok(status == Ok, "Failed to get family count, status %d.\n", status);
ok(count > 0, "Unexpected empty collection.\n");
status = GdipGetFontCollectionFamilyList(NULL, 0, NULL, NULL);
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
found = 123;
status = GdipGetFontCollectionFamilyList(NULL, 0, NULL, &found);
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
ok(found == 123, "Unexpected list count %d.\n", found);
status = GdipGetFontCollectionFamilyList(collection, 0, NULL, NULL);
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
found = 123;
status = GdipGetFontCollectionFamilyList(collection, 0, NULL, &found);
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
ok(found == 123, "Unexpected list count %d.\n", found);
found = 123;
status = GdipGetFontCollectionFamilyList(collection, 1, NULL, &found);
ok(status == InvalidParameter, "Unexpected status %d.\n", status);
ok(found == 123, "Unexpected list count %d.\n", found);
family = NULL;
found = 0;
status = GdipGetFontCollectionFamilyList(collection, 1, &family, &found);
ok(status == Ok, "Failed to get family list, status %d.\n", status);
ok(found == 1, "Unexpected list count %d.\n", found);
ok(family != NULL, "Expected family instance.\n");
family = 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");
GdipDeleteFontFamily(family);
GdipDeleteFontFamily(family2);
}
START_TEST(font)
{
struct GdiplusStartupInput gdiplusStartupInput;
......@@ -1139,6 +1193,7 @@ START_TEST(font)
test_getgenerics();
test_installedfonts();
test_heightgivendpi();
test_GdipGetFontCollectionFamilyList();
GdiplusShutdown(gdiplusToken);
}
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