dwrite/tests: One more test for duplicates in IDWriteTypography.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2015-12-25 15:57:56 +03:00 committed by Alexandre Julliard
parent 4f1ed54c7d
commit f845cca0dc
1 changed files with 17 additions and 2 deletions

View File

@ -1611,13 +1611,13 @@ static void test_typography(void)
count = IDWriteTypography_GetFontFeatureCount(typography); count = IDWriteTypography_GetFontFeatureCount(typography);
ok(count == 2, "got %u\n", count); ok(count == 2, "got %u\n", count);
memset(&feature, 0, sizeof(feature)); memset(&feature, 0xcc, sizeof(feature));
hr = IDWriteTypography_GetFontFeature(typography, 0, &feature); hr = IDWriteTypography_GetFontFeature(typography, 0, &feature);
ok(hr == S_OK, "got 0x%08x\n", hr); 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.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag);
ok(feature.parameter == 1, "got %u\n", feature.parameter); 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); hr = IDWriteTypography_GetFontFeature(typography, 1, &feature);
ok(hr == S_OK, "got 0x%08x\n", hr); 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.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); hr = IDWriteTypography_GetFontFeature(typography, 2, &feature);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); 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); IDWriteTypography_Release(typography);
IDWriteFactory_Release(factory); IDWriteFactory_Release(factory);
} }