[PATCH 1/7] dwrite/tests: One more test for duplicates in IDWriteTypography

Nikolay Sivov nsivov at codeweavers.com
Fri Dec 25 06:57:56 CST 2015


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 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 6ea2734..5e38a07 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);
 }
-- 
2.6.4




More information about the wine-patches mailing list