gdiplus: Added conformance tests for GdipDrawLineI.

This commit is contained in:
Royal Chan 2008-02-25 21:08:01 -08:00 committed by Alexandre Julliard
parent ea92872af0
commit b83abb6122
1 changed files with 39 additions and 0 deletions

View File

@ -346,6 +346,44 @@ static void test_GdipDrawBezierI(void)
ReleaseDC(0, hdc);
}
static void test_GdipDrawLineI(void)
{
GpStatus status;
GpGraphics *graphics = NULL;
GpPen *pen = NULL;
HDC hdc = GetDC(0);
/* make a graphics object and pen object */
status = GdipCreateFromHDC(hdc, &graphics);
expect(Ok, status);
ok(hdc != NULL, "Expected HDC to be initialized\n");
status = GdipCreateFromHDC(hdc, &graphics);
expect(Ok, status);
ok(graphics != NULL, "Expected graphics to be initialized\n");
status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
expect(Ok, status);
ok(pen != NULL, "Expected pen to be initialized\n");
/* InvalidParameter cases: null graphics, null pen */
status = GdipDrawLineI(NULL, NULL, 0, 0, 0, 0);
expect(InvalidParameter, status);
status = GdipDrawLineI(graphics, NULL, 0, 0, 0, 0);
expect(InvalidParameter, status);
status = GdipDrawLineI(NULL, pen, 0, 0, 0, 0);
expect(InvalidParameter, status);
/* successful case */
status = GdipDrawLineI(graphics, pen, 0, 0, 0, 0);
expect(Ok, status);
GdipDeletePen(pen);
ReleaseDC(0, hdc);
}
START_TEST(graphics)
{
struct GdiplusStartupInput gdiplusStartupInput;
@ -363,6 +401,7 @@ START_TEST(graphics)
test_GdipDrawBezierI();
test_GdipDrawArc();
test_GdipDrawArcI();
test_GdipDrawLineI();
GdiplusShutdown(gdiplusToken);
}