[5/5] gdiplus: Add tests for path gradient center point functions.
Vincent Povirk
madewokherd at gmail.com
Mon Mar 12 16:02:59 CDT 2012
-------------- next part --------------
From 0033c400b5fcbfde633f01e0d99d7db8d313bf6c Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Mon, 20 Feb 2012 15:04:07 -0600
Subject: [PATCH 05/14] gdiplus: Add tests for path gradient center point
functions.
---
dlls/gdiplus/tests/brush.c | 54 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c
index 296cf0f..726e855 100644
--- a/dlls/gdiplus/tests/brush.c
+++ b/dlls/gdiplus/tests/brush.c
@@ -852,6 +852,59 @@ static void test_pathgradientpath(void)
expect(Ok, status);
}
+static void test_pathgradientcenterpoint(void)
+{
+ static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
+ GpStatus status;
+ GpPathGradient *grad;
+ GpPointF point;
+
+ status = GdipCreatePathGradient(path_points+1, 2, WrapModeClamp, &grad);
+ expect(Ok, status);
+
+ status = GdipGetPathGradientCenterPoint(NULL, &point);
+ expect(InvalidParameter, status);
+
+ status = GdipGetPathGradientCenterPoint(grad, NULL);
+ expect(InvalidParameter, status);
+
+ status = GdipGetPathGradientCenterPoint(grad, &point);
+ expect(Ok, status);
+ expectf(1.5, point.X);
+ expectf(2.0, point.Y);
+
+ status = GdipSetPathGradientCenterPoint(NULL, &point);
+ expect(InvalidParameter, status);
+
+ status = GdipSetPathGradientCenterPoint(grad, NULL);
+ expect(InvalidParameter, status);
+
+ point.X = 10.0;
+ point.Y = 15.0;
+ status = GdipSetPathGradientCenterPoint(grad, &point);
+ expect(Ok, status);
+
+ point.X = point.Y = -1;
+ status = GdipGetPathGradientCenterPoint(grad, &point);
+ expect(Ok, status);
+ expectf(10.0, point.X);
+ expectf(15.0, point.Y);
+
+ status = GdipDeleteBrush((GpBrush*)grad);
+ expect(Ok, status);
+
+ status = GdipCreatePathGradient(path_points, 3, WrapModeClamp, &grad);
+ expect(Ok, status);
+
+ status = GdipGetPathGradientCenterPoint(grad, &point);
+ expect(Ok, status);
+ todo_wine expectf(1.0, point.X);
+ todo_wine expectf(4.0/3.0, point.Y);
+
+ status = GdipDeleteBrush((GpBrush*)grad);
+ expect(Ok, status);
+}
+
START_TEST(brush)
{
struct GdiplusStartupInput gdiplusStartupInput;
@@ -877,6 +930,7 @@ START_TEST(brush)
test_linelinearblend();
test_gradientsurroundcolorcount();
test_pathgradientpath();
+ test_pathgradientcenterpoint();
GdiplusShutdown(gdiplusToken);
}
--
1.7.9
More information about the wine-patches
mailing list