From 7bac9a025a687832e805c43c27305ecbc7082433 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 22 Aug 2017 12:42:14 +0300 Subject: [PATCH] dwrite/tests: Some tests for system font set. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/tests/font.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index fe2d802f14d..417cc21aa21 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -2291,7 +2291,9 @@ static void test_system_fontcollection(void) hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection1, (void**)&collection1); if (hr == S_OK) { + IDWriteFontSet *fontset, *fontset2; IDWriteFontFamily1 *family1; + IDWriteFactory3 *factory3; hr = IDWriteFontCollection1_QueryInterface(collection1, &IID_IDWriteFontCollection, (void**)&coll2); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -2306,6 +2308,39 @@ static void test_system_fontcollection(void) hr = IDWriteFontCollection1_GetFontFamily(collection1, 0, &family1); ok(hr == S_OK, "got 0x%08x\n", hr); IDWriteFontFamily1_Release(family1); + + /* system fontset */ + EXPECT_REF(collection1, 2); + EXPECT_REF(factory, 2); + hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset); + todo_wine + ok(hr == S_OK, "Failed to get fontset, hr %#x.\n", hr); + if (hr == S_OK) { + EXPECT_REF(collection1, 2); + EXPECT_REF(factory, 2); + EXPECT_REF(fontset, 1); + + hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset2); + ok(hr == S_OK, "Failed to get fontset, hr %#x.\n", hr); + ok(fontset != fontset2, "Expected new fontset instance.\n"); + EXPECT_REF(fontset2, 1); + IDWriteFontSet_Release(fontset2); + + hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void **)&factory3); + ok(hr == S_OK, "Failed to get IDWriteFactory3 interface, hr %#x.\n", hr); + + EXPECT_REF(factory, 3); + hr = IDWriteFactory3_GetSystemFontSet(factory3, &fontset2); + ok(hr == S_OK, "Failed to get system font set, hr %#x.\n", hr); + ok(fontset != fontset2, "Expected new fontset instance.\n"); + EXPECT_REF(fontset2, 1); + EXPECT_REF(factory, 4); + + IDWriteFontSet_Release(fontset2); + IDWriteFontSet_Release(fontset); + + IDWriteFactory3_Release(factory3); + } IDWriteFontCollection1_Release(collection1); } else