gdiplus: Some tests for GdipGetLineRect
Nikolay Sivov
bunglehead at gmail.com
Fri Feb 6 03:53:13 CST 2009
Changelog:
- Some tests for GdipGetLineRect
>From e63fa172f42cc3ba5b3d1e63cc72969cc67ce67a Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Fri, 6 Feb 2009 12:45:52 +0300
Subject: Some tests for GdipGetLineRect
---
dlls/gdiplus/tests/brush.c | 62 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c
index ae83184..7173619 100644
--- a/dlls/gdiplus/tests/brush.c
+++ b/dlls/gdiplus/tests/brush.c
@@ -283,6 +283,67 @@ static void test_texturewrap(void)
ReleaseDC(0, hdc);
}
+static void test_gradientgetrect(void)
+{
+ GpLineGradient *brush;
+ GpRectF rectf;
+ GpStatus status;
+ GpPointF pt1, pt2;
+
+ pt1.X = pt1.Y = 1.0;
+ pt2.X = pt2.Y = 100.0;
+ status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
+ expect(Ok, status);
+ memset(&rectf, 0, sizeof(GpRectF));
+ status = GdipGetLineRect(brush, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == 1.0, "Expected 1.0 got %.2f\n", rectf.X);
+ ok(rectf.Y == 1.0, "Expected 1.0 got %.2f\n", rectf.Y);
+ ok(rectf.Width == 99.0, "Expected 99.0 got %.2f\n", rectf.Width);
+ ok(rectf.Height == 99.0, "Expected 99.0 got %.2f\n", rectf.Height);
+ status = GdipDeleteBrush((GpBrush*)brush);
+ /* vertical gradient */
+ pt1.X = pt1.Y = pt2.X = 0.0;
+ pt2.Y = 10.0;
+ status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
+ expect(Ok, status);
+ memset(&rectf, 0, sizeof(GpRectF));
+ status = GdipGetLineRect(brush, &rectf);
+ expect(Ok, status);
+ todo_wine ok(rectf.X == -5.0, "Expected -5.0 got %.2f\n", rectf.X);
+ ok(rectf.Y == 0.0, "Expected 0.0 got %.2f\n", rectf.Y);
+ todo_wine ok(rectf.Width == 10.0, "Expected 10.0 got %.2f\n", rectf.Width);
+ ok(rectf.Height == 10.0, "Expected 10.0 got %.2f\n", rectf.Height);
+ status = GdipDeleteBrush((GpBrush*)brush);
+ /* horizontal gradient */
+ pt1.X = pt1.Y = pt2.Y = 0.0;
+ pt2.X = 10.0;
+ status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
+ expect(Ok, status);
+ memset(&rectf, 0, sizeof(GpRectF));
+ status = GdipGetLineRect(brush, &rectf);
+ expect(Ok, status);
+ ok(rectf.X == 0.0, "Expected 0.0 got %.2f\n", rectf.X);
+ todo_wine ok(rectf.Y == -5.0, "Expected -5.0 got %.2f\n", rectf.Y);
+ ok(rectf.Width == 10.0, "Expected 10.0 got %.2f\n", rectf.Width);
+ todo_wine ok(rectf.Height == 10.0, "Expected 10.0 got %.2f\n", rectf.Height);
+ status = GdipDeleteBrush((GpBrush*)brush);
+ /* from rect with 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);
+ ok(rectf.X == 10.0, "Expected 10.0 got %.2f\n", rectf.X);
+ ok(rectf.Y == 10.0, "Expected 10.0 got %.2f\n", rectf.Y);
+ ok(rectf.Width == 100.0, "Expected 100.0 got %.2f\n", rectf.Width);
+ ok(rectf.Height == 100.0, "Expected 100.0 got %.2f\n", rectf.Height);
+ status = GdipDeleteBrush((GpBrush*)brush);
+}
+
START_TEST(brush)
{
struct GdiplusStartupInput gdiplusStartupInput;
@@ -303,6 +364,7 @@ START_TEST(brush)
test_getgamma();
test_transform();
test_texturewrap();
+ test_gradientgetrect();
GdiplusShutdown(gdiplusToken);
}
--
1.5.6.5
More information about the wine-patches
mailing list