From f845cca0dc4e9f2194e0ab60798a3e586cd4ad45 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 25 Dec 2015 15:57:56 +0300 Subject: [PATCH] dwrite/tests: One more test for duplicates in IDWriteTypography. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/tests/layout.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 6ea27340ed6..5e38a07db62 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -1611,13 +1611,13 @@ static void test_typography(void) count = IDWriteTypography_GetFontFeatureCount(typography); ok(count == 2, "got %u\n", count); - memset(&feature, 0, sizeof(feature)); + memset(&feature, 0xcc, sizeof(feature)); hr = IDWriteTypography_GetFontFeature(typography, 0, &feature); ok(hr == S_OK, "got 0x%08x\n", hr); ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); ok(feature.parameter == 1, "got %u\n", feature.parameter); - memset(&feature, 0, sizeof(feature)); + memset(&feature, 0xcc, sizeof(feature)); hr = IDWriteTypography_GetFontFeature(typography, 1, &feature); ok(hr == S_OK, "got 0x%08x\n", hr); ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); @@ -1626,6 +1626,21 @@ static void test_typography(void) hr = IDWriteTypography_GetFontFeature(typography, 2, &feature); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + /* duplicated with same parameter value */ + feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING; + feature.parameter = 0; + hr = IDWriteTypography_AddFontFeature(typography, feature); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = IDWriteTypography_GetFontFeatureCount(typography); + ok(count == 3, "got %u\n", count); + + memset(&feature, 0xcc, sizeof(feature)); + hr = IDWriteTypography_GetFontFeature(typography, 2, &feature); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); + ok(feature.parameter == 0, "got %u\n", feature.parameter); + IDWriteTypography_Release(typography); IDWriteFactory_Release(factory); }