gdiplus: Implemented GdipGetCustomLineCapBaseInset + test.

This commit is contained in:
Nikolay Sivov 2008-07-26 12:48:11 +04:00 committed by Alexandre Julliard
parent 5038845cf2
commit 6c6e8f489e
3 changed files with 39 additions and 4 deletions

View File

@ -156,12 +156,12 @@ GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap(GpCustomLineCap* custom,
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap* custom,
REAL* inset)
{
static int calls;
if(!custom || !inset)
return InvalidParameter;
if(!(calls++))
FIXME("not implemented\n");
*inset = custom->inset;
return NotImplemented;
return Ok;
}
GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap* custom,

View File

@ -23,6 +23,7 @@
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expectf(expected, got) ok(got == expected, "Expected %.2f, got %.2f\n", expected, got)
static void test_constructor_destructor(void)
{
@ -116,6 +117,38 @@ static void test_linejoin(void)
GdipDeletePath(path);
}
static void test_inset(void)
{
GpCustomLineCap *custom;
GpPath *path;
REAL inset;
GpStatus stat;
stat = GdipCreatePath(FillModeAlternate, &path);
expect(Ok, stat);
stat = GdipAddPathRectangle(path, 5.0, 5.0, 10.0, 10.0);
expect(Ok, stat);
stat = GdipCreateCustomLineCap(NULL, path, LineCapFlat, 0.0, &custom);
expect(Ok, stat);
/* NULL args */
stat = GdipGetCustomLineCapBaseInset(NULL, NULL);
expect(InvalidParameter, stat);
stat = GdipGetCustomLineCapBaseInset(NULL, &inset);
expect(InvalidParameter, stat);
stat = GdipGetCustomLineCapBaseInset(custom, NULL);
expect(InvalidParameter, stat);
/* valid args */
inset = (REAL)0xdeadbeef;
stat = GdipGetCustomLineCapBaseInset(custom, &inset);
expect(Ok, stat);
expectf(0.0, inset);
GdipDeleteCustomLineCap(custom);
GdipDeletePath(path);
}
START_TEST(customlinecap)
{
struct GdiplusStartupInput gdiplusStartupInput;
@ -130,6 +163,7 @@ START_TEST(customlinecap)
test_constructor_destructor();
test_linejoin();
test_inset();
GdiplusShutdown(gdiplusToken);
}

View File

@ -326,6 +326,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*);
GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap*,GpLineCap,
GpLineCap);
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap*,GpLineCap*);
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap*,REAL*);
GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap*,GpLineJoin*);
GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin(GpCustomLineCap*,GpLineJoin);