Nikolay Sivov : gdiplus/tests: Some tests for GdipGetFontCollectionFamilyList() and system collection.
Alexandre Julliard
julliard at winehq.org
Tue Nov 21 16:33:50 CST 2017
Module: wine
Branch: master
Commit: 4616954a9dc25ab9246fa43bbcd30ac3b7ec7992
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4616954a9dc25ab9246fa43bbcd30ac3b7ec7992
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Nov 21 09:32:07 2017 +0300
gdiplus/tests: Some tests for GdipGetFontCollectionFamilyList() and system collection.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/tests/font.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index 2cae481..6c7738c 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -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);
}
More information about the wine-cvs
mailing list