gdiplus: Implemented GdipPathIterIsValid with tests.

This commit is contained in:
Nikolay Sivov 2008-08-05 20:56:17 +04:00 committed by Alexandre Julliard
parent b7e81d3e54
commit 09950e3ab5
4 changed files with 54 additions and 1 deletions

View file

@ -455,7 +455,7 @@
@ stdcall GdipPathIterGetCount(ptr ptr)
@ stdcall GdipPathIterGetSubpathCount(ptr ptr)
@ stdcall GdipPathIterHasCurve(ptr ptr)
@ stub GdipPathIterIsValid
@ stdcall GdipPathIterIsValid(ptr ptr)
@ stdcall GdipPathIterNextMarker(ptr ptr ptr ptr)
@ stub GdipPathIterNextMarkerPath
@ stub GdipPathIterNextPathType

View file

@ -225,3 +225,13 @@ GpStatus WINGDIPAPI GdipPathIterEnumerate(GpPathIterator* iterator, INT* resultC
return GdipPathIterCopyData(iterator, resultCount, points, types, 0, count-1);
}
GpStatus WINGDIPAPI GdipPathIterIsValid(GpPathIterator* iterator, BOOL* valid)
{
if(!iterator || !valid)
return InvalidParameter;
*valid = TRUE;
return Ok;
}

View file

@ -214,6 +214,47 @@ static void test_getsubpathcount(void)
GdipDeletePath(path);
}
static void test_isvalid(void)
{
GpPath *path;
GpPathIterator *iter;
GpStatus stat;
BOOL isvalid;
INT start, end, result;
GdipCreatePath(FillModeAlternate, &path);
/* NULL args */
GdipCreatePathIter(&iter, path);
stat = GdipPathIterIsValid(NULL, NULL);
expect(InvalidParameter, stat);
stat = GdipPathIterIsValid(iter, NULL);
expect(InvalidParameter, stat);
stat = GdipPathIterIsValid(NULL, &isvalid);
expect(InvalidParameter, stat);
GdipDeletePathIter(iter);
/* on empty path */
GdipCreatePathIter(&iter, path);
isvalid = FALSE;
stat = GdipPathIterIsValid(iter, &isvalid);
expect(Ok, stat);
expect(TRUE, isvalid);
GdipDeletePathIter(iter);
/* no markers */
GdipAddPathLine(path, 50.0, 50.0, 110.0, 40.0);
GdipCreatePathIter(&iter, path);
GdipPathIterNextMarker(iter, &result, &start, &end);
isvalid = FALSE;
stat = GdipPathIterIsValid(iter, &isvalid);
expect(Ok, stat);
expect(TRUE, isvalid);
GdipDeletePathIter(iter);
GdipDeletePath(path);
}
START_TEST(pathiterator)
{
struct GdiplusStartupInput gdiplusStartupInput;
@ -230,6 +271,7 @@ START_TEST(pathiterator)
test_hascurve();
test_nextmarker();
test_getsubpathcount();
test_isvalid();
GdiplusShutdown(gdiplusToken);
}

View file

@ -333,6 +333,7 @@ GpStatus WINGDIPAPI GdipPathIterGetCount(GpPathIterator*,INT*);
GpStatus WINGDIPAPI GdipPathIterGetSubpathCount(GpPathIterator*,INT*);
GpStatus WINGDIPAPI GdipPathIterEnumerate(GpPathIterator*,INT*,GpPointF*,BYTE*,INT);
GpStatus WINGDIPAPI GdipPathIterHasCurve(GpPathIterator*,BOOL*);
GpStatus WINGDIPAPI GdipPathIterIsValid(GpPathIterator*,BOOL*);
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap*,GpCustomLineCap**);
GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath*,GpPath*,GpLineCap,REAL,