Commit 02773e1f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite/tests: A couple of tests for matching with invalid font properties.

parent 0973f465
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment