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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 25 11:19:21 CST 2015


Module: wine
Branch: master
Commit: f845cca0dc4e9f2194e0ab60798a3e586cd4ad45
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f845cca0dc4e9f2194e0ab60798a3e586cd4ad45

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Dec 25 15:57:56 2015 +0300

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

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);
 }




More information about the wine-cvs mailing list