From 3f883e1534b501c134f260e248d8c496c727b7a2 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 7 May 2009 11:28:08 -0500 Subject: [PATCH] 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..c6e7fd0 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) -- 1.5.4.3