[PATCH] gdiplus/tests: Add some font family pointer tests.
Sven Baars
sven.wine at gmail.com
Sat Jan 26 08:23:04 CST 2019
Signed-off-by: Sven Baars <sven.wine at gmail.com>
---
This patch supersedes 156918. Note that the changed implementation in 156918 makes most
of these tests succeed, and doesn't cause any crashes, so this still does not contain
a test of whatever is the actual problem that does not allow for just copying
the pointer.
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 03e7a04e08..33b75c5bc5 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)
--
2.17.1
More information about the wine-devel
mailing list