Nikolay Sivov : dwrite/tests: A couple of tests for matching with invalid font properties.
Alexandre Julliard
julliard at winehq.org
Wed Jul 20 10:28:52 CDT 2016
Module: wine
Branch: master
Commit: 02773e1f15d34663bccb2a280f421753d19b12ef
URL: http://source.winehq.org/git/wine.git/?a=commit;h=02773e1f15d34663bccb2a280f421753d19b12ef
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Jul 19 23:03:00 2016 +0300
dwrite/tests: A couple of tests for matching with invalid font properties.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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);
More information about the wine-cvs
mailing list