Sven Baars : gdiplus/tests: Add some font family pointer tests.
Alexandre Julliard
julliard at winehq.org
Mon Jan 28 16:17:02 CST 2019
Module: wine
Branch: master
Commit: 5f25d7a9a9f2ed626e5342adef8879fee26a73e2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5f25d7a9a9f2ed626e5342adef8879fee26a73e2
Author: Sven Baars <sven.wine at gmail.com>
Date: Sat Jan 26 15:23:04 2019 +0100
gdiplus/tests: Add some font family pointer tests.
Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/tests/font.c | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index 03e7a04..33b75c5 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -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)
More information about the wine-cvs
mailing list