[PATCH 2/4] dwrite/tests: Some tests for CreateGdiCompatibleTextLayout()

Nikolay Sivov nsivov at codeweavers.com
Thu Jul 16 05:11:25 CDT 2015


---

-------------- next part --------------
From 07427187d1dc93874ee328ae3e0bd6ceab5444c3 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu, 16 Jul 2015 00:37:44 +0300
Subject: [PATCH 2/4] dwrite/tests: Some tests for
 CreateGdiCompatibleTextLayout()

---
 dlls/dwrite/tests/layout.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index a2a5d39..1494d59 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -785,6 +785,16 @@ static void test_CreateTextLayout(void)
     IDWriteFactory_Release(factory);
 }
 
+static DWRITE_MATRIX layoutcreate_transforms[] = {
+    { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 },
+    { 1.0, 0.0, 0.0, 1.0, 0.3, 0.2 },
+    { 1.0, 0.0, 0.0, 1.0,-0.3,-0.2 },
+
+    { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
+    { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
+    { 1.0, 2.0, 0.5, 1.0, 0.0, 0.0 },
+};
+
 static void test_CreateGdiCompatibleTextLayout(void)
 {
     static const WCHAR strW[] = {'s','t','r','i','n','g',0};
@@ -793,6 +803,7 @@ static void test_CreateGdiCompatibleTextLayout(void)
     IDWriteFactory *factory;
     FLOAT dimension;
     HRESULT hr;
+    int i;
 
     factory = create_factory();
 
@@ -839,6 +850,24 @@ static void test_CreateGdiCompatibleTextLayout(void)
     ok(dimension == 100.0, "got %f\n", dimension);
 
     IDWriteTextLayout_Release(layout);
+
+    /* negative, zero ppdip */
+    hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 100.0, 100.0, -1.0, NULL, FALSE, &layout);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteTextLayout_Release(layout);
+
+    hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 100.0, 100.0, 0.0, NULL, FALSE, &layout);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    IDWriteTextLayout_Release(layout);
+
+    /* transforms */
+    for (i = 0; i < sizeof(layoutcreate_transforms)/sizeof(layoutcreate_transforms[0]); i++) {
+        hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 1, format, 100.0, 100.0, 1.0,
+            &layoutcreate_transforms[i], FALSE, &layout);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
+        IDWriteTextLayout_Release(layout);
+    }
+
     IDWriteTextFormat_Release(format);
     IDWriteFactory_Release(factory);
 }
-- 
2.1.4



More information about the wine-patches mailing list