Jeff Smith : gdiplus/tests: Add widen-path test for UnitWorld zero-width line.

Alexandre Julliard julliard at winehq.org
Mon Apr 6 15:53:19 CDT 2020


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

Author: Jeff Smith <whydoubt at gmail.com>
Date:   Thu Apr  2 15:58:38 2020 -0500

gdiplus/tests: Add widen-path test for UnitWorld zero-width line.

Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/tests/graphicspath.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c
index 83a5e99138..7fd9b02b28 100644
--- a/dlls/gdiplus/tests/graphicspath.c
+++ b/dlls/gdiplus/tests/graphicspath.c
@@ -1077,6 +1077,13 @@ static path_test_t widenline_dash_path[] = {
     {45.0, 10.0,  PathPointTypeLine|PathPointTypeCloseSubpath,  0, 0}, /*7*/
     };
 
+static path_test_t widenline_unit_path[] = {
+    {5.0, 9.5,   PathPointTypeStart, 0, 1}, /*0*/
+    {50.0, 9.5,  PathPointTypeLine,  0, 1}, /*1*/
+    {50.0, 10.5, PathPointTypeLine,  0, 1}, /*2*/
+    {5.0, 10.5,  PathPointTypeLine|PathPointTypeCloseSubpath,  0, 1} /*3*/
+    };
+
 static void test_widen(void)
 {
     GpStatus status;
@@ -1241,6 +1248,23 @@ static void test_widen(void)
     expect(Ok, status);
     todo_wine expect(0, count);
 
+    /* pen width = 0 pixels, UnitWorld - result is a path 1 unit wide */
+    GdipDeletePen(pen);
+    status = GdipCreatePen1(0xffffffff, 0.0, UnitWorld, &pen);
+    expect(Ok, status);
+
+    status = GdipResetPath(path);
+    expect(Ok, status);
+    status = GdipAddPathLine(path, 5.0, 10.0, 50.0, 10.0);
+    expect(Ok, status);
+
+    status = GdipWidenPath(path, pen, m, 1.0);
+    expect(Ok, status);
+
+    status = GdipGetPointCount(path, &count);
+    expect(Ok, status);
+    ok_path_fudge(path, widenline_unit_path, ARRAY_SIZE(widenline_unit_path), FALSE, 0.000005);
+
     GdipDeleteMatrix(m);
     GdipDeletePen(pen);
     GdipDeletePath(path);




More information about the wine-cvs mailing list