Vincent Povirk : gdiplus: Expand the GdipGetLineRect tests.

Alexandre Julliard julliard at winehq.org
Fri May 8 08:06:27 CDT 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Thu May  7 11:28:08 2009 -0500

gdiplus: Expand the GdipGetLineRect tests.

---

 dlls/gdiplus/tests/brush.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c
index cabbd7f..8ce5adb 100644
--- a/dlls/gdiplus/tests/brush.c
+++ b/dlls/gdiplus/tests/brush.c
@@ -328,6 +328,34 @@ static void test_gradientgetrect(void)
     expectf(10.0, rectf.Width);
     todo_wine expectf(10.0, rectf.Height);
     status = GdipDeleteBrush((GpBrush*)brush);
+    /* slope = -1 */
+    pt1.X = pt1.Y = 0.0;
+    pt2.X = 20.0;
+    pt2.Y = -20.0;
+    status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
+    expect(Ok, status);
+    memset(&rectf, 0, sizeof(GpRectF));
+    status = GdipGetLineRect(brush, &rectf);
+    expect(Ok, status);
+    expectf(0.0, rectf.X);
+    expectf(-20.0, rectf.Y);
+    expectf(20.0, rectf.Width);
+    expectf(20.0, rectf.Height);
+    status = GdipDeleteBrush((GpBrush*)brush);
+    /* slope = 1/100 */
+    pt1.X = pt1.Y = 0.0;
+    pt2.X = 100.0;
+    pt2.Y = 1.0;
+    status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
+    expect(Ok, status);
+    memset(&rectf, 0, sizeof(GpRectF));
+    status = GdipGetLineRect(brush, &rectf);
+    expect(Ok, status);
+    expectf(0.0, rectf.X);
+    expectf(0.0, rectf.Y);
+    expectf(100.0, rectf.Width);
+    expectf(1.0, rectf.Height);
+    status = GdipDeleteBrush((GpBrush*)brush);
     /* from rect with LinearGradientModeHorizontal */
     rectf.X = rectf.Y = 10.0;
     rectf.Width = rectf.Height = 100.0;
@@ -342,6 +370,20 @@ static void test_gradientgetrect(void)
     expectf(100.0, rectf.Width);
     expectf(100.0, rectf.Height);
     status = GdipDeleteBrush((GpBrush*)brush);
+    /* passing negative Width/Height to LinearGradientModeHorizontal */
+    rectf.X = rectf.Y = 10.0;
+    rectf.Width = rectf.Height = -100.0;
+    status = GdipCreateLineBrushFromRect(&rectf, 0, 0, LinearGradientModeHorizontal,
+        WrapModeTile, &brush);
+    expect(Ok, status);
+    memset(&rectf, 0, sizeof(GpRectF));
+    status = GdipGetLineRect(brush, &rectf);
+    expect(Ok, status);
+    todo_wine expectf(10.0, rectf.X);
+    todo_wine expectf(10.0, rectf.Y);
+    todo_wine expectf(-100.0, rectf.Width);
+    todo_wine expectf(-100.0, rectf.Height);
+    status = GdipDeleteBrush((GpBrush*)brush);
 }
 
 static void test_lineblend(void)




More information about the wine-cvs mailing list