From a1ff2c44ea156c7d0f469341328d804bee8675b1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 1 Nov 2018 12:53:27 +0300 Subject: [PATCH] gdiplus/tests: Add parameter validation test for GdipGetFontCollectionFamilyCount(). Signed-off-by: Nikolay Sivov Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/tests/font.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 961d8459cb4..0a3a3bef79a 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -1238,6 +1238,27 @@ static void test_GdipGetFontCollectionFamilyList(void) GdipDeleteFontFamily(family2); } +static void test_GdipGetFontCollectionFamilyCount(void) +{ + GpFontCollection *collection; + GpStatus status; + INT count; + + status = GdipGetFontCollectionFamilyCount(NULL, NULL); + ok(status == InvalidParameter, "Unexpected status %d.\n", status); + + count = 123; + status = GdipGetFontCollectionFamilyCount(NULL, &count); + ok(status == InvalidParameter, "Unexpected status %d.\n", status); + ok(count == 123, "Unexpected family count %d.\n", count); + + status = GdipNewInstalledFontCollection(&collection); + ok(status == Ok, "Failed to get system collection, status %d.\n", status); + + status = GdipGetFontCollectionFamilyCount(collection, NULL); + ok(status == InvalidParameter, "Unexpected status %d.\n", status); +} + START_TEST(font) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1269,6 +1290,7 @@ START_TEST(font) test_installedfonts(); test_heightgivendpi(); test_GdipGetFontCollectionFamilyList(); + test_GdipGetFontCollectionFamilyCount(); GdiplusShutdown(gdiplusToken); }