[PATCH 2/3] dwrite/tests: A couple of tests for matching with invalid font properties

Nikolay Sivov nsivov at codeweavers.com
Tue Jul 19 15:03:00 CDT 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/dwrite/tests/font.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index 0459285..3b402b8 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -2970,6 +2970,20 @@ static void test_GetFirstMatchingFont(void)
     IDWriteFont_Release(font);
     IDWriteFont_Release(font2);
 
+    /* out-of-range font props are allowed */
+    hr = IDWriteFontFamily_GetFirstMatchingFont(family, 1000, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &font);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteFont_Release(font);
+
+    hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, 10, DWRITE_FONT_STYLE_NORMAL, &font);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteFont_Release(font);
+
+    hr = IDWriteFontFamily_GetFirstMatchingFont(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
+        10, &font);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteFont_Release(font);
+
     IDWriteFontFamily_Release(family);
 
     font = get_tahoma_instance(factory, DWRITE_FONT_STYLE_ITALIC);
@@ -2998,6 +3012,22 @@ static void test_GetMatchingFonts(void)
     hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family);
     ok(hr == S_OK, "got 0x%08x\n", hr);
 
+    /* out-of-range font props are allowed */
+    hr = IDWriteFontFamily_GetMatchingFonts(family, 1000, DWRITE_FONT_STRETCH_NORMAL,
+        DWRITE_FONT_STYLE_NORMAL, &fontlist);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteFontList_Release(fontlist);
+
+    hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, 10,
+        DWRITE_FONT_STYLE_NORMAL, &fontlist);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteFontList_Release(fontlist);
+
+    hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL,
+        10, &fontlist);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteFontList_Release(fontlist);
+
     hr = IDWriteFontFamily_GetMatchingFonts(family, DWRITE_FONT_WEIGHT_NORMAL,
         DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &fontlist);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-- 
2.8.1




More information about the wine-patches mailing list