Commit b8f56c0b authored by Hugh Bellamy's avatar Hugh Bellamy Committed by Alexandre Julliard

gdiplus: Add GdipCreateLineBrushFromRectWithAngle tests.

parent c3252c37
......@@ -481,9 +481,12 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect
TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
wrap, line);
if (!rect || !rect->Width || !rect->Height)
if (!rect || !line || wrap == WrapModeClamp)
return InvalidParameter;
if (!rect->Width || !rect->Height)
return OutOfMemory;
angle = fmodf(angle, 360);
if (angle < 0)
angle += 360;
......
......@@ -72,6 +72,68 @@ static void test_createHatchBrush(void)
expect(InvalidParameter, status);
}
static void test_createLineBrushFromRectWithAngle(void)
{
GpStatus status;
GpLineGradient *brush;
GpRectF rect1 = { 1, 3, 1, 2 };
GpRectF rect2 = { 1, 3, -1, -2 };
GpRectF rect3 = { 1, 3, 0, 1 };
GpRectF rect4 = { 1, 3, 1, 0 };
status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 0, TRUE, WrapModeTile, &brush);
expect(Ok, status);
GdipDeleteBrush((GpBrush *) brush);
status = GdipCreateLineBrushFromRectWithAngle(&rect2, 10, 11, 135, TRUE, (WrapMode)(WrapModeTile - 1), &brush);
expect(Ok, status);
GdipDeleteBrush((GpBrush *) brush);
status = GdipCreateLineBrushFromRectWithAngle(&rect2, 10, 11, -225, FALSE, (WrapMode)(WrapModeTile - 1), &brush);
expect(Ok, status);
GdipDeleteBrush((GpBrush *) brush);
status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 405, TRUE, (WrapMode)(WrapModeClamp + 1), &brush);
expect(Ok, status);
GdipDeleteBrush((GpBrush *) brush);
status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 45, FALSE, (WrapMode)(WrapModeClamp + 1), &brush);
expect(Ok, status);
GdipDeleteBrush((GpBrush *) brush);
status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 90, TRUE, WrapModeTileFlipX, &brush);
expect(Ok, status);
status = GdipCreateLineBrushFromRectWithAngle(NULL, 10, 11, 90, TRUE, WrapModeTile, &brush);
expect(InvalidParameter, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect3, 10, 11, 90, TRUE, WrapModeTileFlipXY, &brush);
expect(OutOfMemory, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect4, 10, 11, 90, TRUE, WrapModeTileFlipXY, &brush);
expect(OutOfMemory, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect3, 10, 11, 90, TRUE, WrapModeTileFlipXY, NULL);
expect(InvalidParameter, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect4, 10, 11, 90, TRUE, WrapModeTileFlipXY, NULL);
expect(InvalidParameter, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect3, 10, 11, 90, TRUE, WrapModeClamp, &brush);
expect(InvalidParameter, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect4, 10, 11, 90, TRUE, WrapModeClamp, &brush);
expect(InvalidParameter, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 90, TRUE, WrapModeClamp, &brush);
expect(InvalidParameter, status);
status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 90, TRUE, WrapModeTile, NULL);
expect(InvalidParameter, status);
GdipDeleteBrush((GpBrush *) brush);
}
static void test_type(void)
{
GpStatus status;
......@@ -1612,6 +1674,7 @@ START_TEST(brush)
test_constructor_destructor();
test_createHatchBrush();
test_createLineBrushFromRectWithAngle();
test_type();
test_gradientblendcount();
test_getblend();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment