Vincent Povirk : gdiplus/tests: Add test for GdipWidenPath.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 11 09:59:45 CST 2016


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Feb 10 16:02:47 2016 -0600

gdiplus/tests: Add test for GdipWidenPath.

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

---

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

diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c
index 6d4171c..aa44911 100644
--- a/dlls/gdiplus/tests/graphicspath.c
+++ b/dlls/gdiplus/tests/graphicspath.c
@@ -1055,6 +1055,62 @@ static void test_flatten(void)
     GdipDeletePath(path);
 }
 
+static path_test_t widenline_path[] = {
+    {5.0, 5.0,   PathPointTypeStart, 0, 0}, /*0*/
+    {50.0, 5.0,  PathPointTypeLine,  0, 0}, /*1*/
+    {50.0, 15.0, PathPointTypeLine,  0, 0}, /*2*/
+    {5.0, 15.0,  PathPointTypeLine|PathPointTypeCloseSubpath,  0, 0} /*3*/
+    };
+
+static void test_widen(void)
+{
+    GpStatus status;
+    GpPath *path;
+    GpPen *pen;
+    GpMatrix *m;
+
+    status = GdipCreatePath(FillModeAlternate, &path);
+    expect(Ok, status);
+    status = GdipCreatePen1(0xffffffff, 10.0, UnitPixel, &pen);
+    expect(Ok, status);
+    status = GdipCreateMatrix(&m);
+    expect(Ok, status);
+
+    /* NULL arguments */
+    status = GdipAddPathLine(path, 5.0, 10.0, 50.0, 10.0);
+    expect(Ok, status);
+    status = GdipWidenPath(NULL, NULL, NULL, 0.0);
+    expect(InvalidParameter, status);
+    status = GdipWidenPath(path, pen, m, 0.0);
+    expect(Ok, status);
+    status = GdipWidenPath(path, pen, NULL, 1.0);
+    expect(Ok, status);
+    status = GdipWidenPath(path, NULL, m, 1.0);
+    expect(InvalidParameter, status);
+    status = GdipWidenPath(NULL, pen, m, 1.0);
+    expect(InvalidParameter, status);
+
+    /* widen empty path */
+    status = GdipResetPath(path);
+    expect(Ok, status);
+    status = GdipWidenPath(path, pen, m, 1.0);
+    expect(OutOfMemory, status);
+
+    /* horizontal line */
+    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);
+    ok_path(path, widenline_path, sizeof(widenline_path)/sizeof(path_test_t), FALSE);
+
+    GdipDeleteMatrix(m);
+    GdipDeletePen(pen);
+    GdipDeletePath(path);
+}
+
 static void test_isvisible(void)
 {
     GpPath *path;
@@ -1163,6 +1219,7 @@ START_TEST(graphicspath)
     test_reverse();
     test_addpie();
     test_flatten();
+    test_widen();
     test_isvisible();
     test_empty_rect();
 




More information about the wine-cvs mailing list