gdiplus/tests: Add Pen Transform tests.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2016-01-24 18:23:58 +11:00 committed by Alexandre Julliard
parent 0a7cd7c153
commit a4d95074b9
1 changed files with 64 additions and 0 deletions

View File

@ -366,6 +366,69 @@ static void test_compoundarray(void)
GdipDeletePen(pen);
}
static void test_transform(void)
{
GpStatus status;
GpPen *pen;
GpMatrix *matrix, *matrix2;
REAL values[6];
status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
expect(Ok, status);
status = GdipCreateMatrix(&matrix);
expect(Ok, status);
status = GdipGetPenTransform(pen, matrix);
todo_wine expect(Ok, status);
status = GdipGetMatrixElements(matrix, values);
expect(Ok, status);
expectf(1.0, values[0]);
expectf(0.0, values[1]);
expectf(0.0, values[2]);
expectf(1.0, values[3]);
expectf(0.0, values[4]);
expectf(0.0, values[5]);
GdipCreateMatrix2(3.0, -2.0, 5.0, 2.0, 6.0, 3.0, &matrix2);
status = GdipSetPenTransform(pen, matrix2);
todo_wine expect(Ok, status);
GdipDeleteMatrix(matrix2);
status = GdipGetPenTransform(pen, matrix);
todo_wine expect(Ok, status);
status = GdipGetMatrixElements(matrix, values);
expect(Ok, status);
todo_wine {
expectf(3.0, values[0]);
expectf(-2.0, values[1]);
expectf(5.0, values[2]);
expectf(2.0, values[3]);
expectf(6.0, values[4]);
expectf(3.0, values[5]);
}
status = GdipResetPenTransform(pen);
todo_wine expect(Ok, status);
status = GdipGetPenTransform(pen, matrix);
todo_wine expect(Ok, status);
status = GdipGetMatrixElements(matrix, values);
expect(Ok, status);
expectf(1.0, values[0]);
expectf(0.0, values[1]);
expectf(0.0, values[2]);
expectf(1.0, values[3]);
expectf(0.0, values[4]);
expectf(0.0, values[5]);
GdipDeletePen(pen);
GdipDeleteMatrix(matrix);
}
START_TEST(pen)
{
struct GdiplusStartupInput gdiplusStartupInput;
@ -387,6 +450,7 @@ START_TEST(pen)
test_customcap();
test_penfilltype();
test_compoundarray();
test_transform();
GdiplusShutdown(gdiplusToken);
}