ReactOS  0.4.14-dev-297-g23e575c
pathiterator.c File Reference
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"
Include dependency graph for pathiterator.c:

Go to the source code of this file.

Macros

#define expect(expected, got)   ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
 

Functions

static void test_constructor_destructor (void)
 
static void test_hascurve (void)
 
static void test_nextmarker (void)
 
static void test_nextmarkerpath (void)
 
static void test_getsubpathcount (void)
 
static void test_isvalid (void)
 
static void test_nextsubpathpath (void)
 
static void test_nextsubpath (void)
 
static void test_nextpathtype (void)
 
 START_TEST (pathiterator)
 

Macro Definition Documentation

◆ expect

#define expect (   expected,
  got 
)    ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)

Definition at line 25 of file pathiterator.c.

Function Documentation

◆ START_TEST()

START_TEST ( pathiterator  )

Definition at line 563 of file pathiterator.c.

564 {
565  struct GdiplusStartupInput gdiplusStartupInput;
567  HMODULE hmsvcrt;
568  int (CDECL * _controlfp_s)(unsigned int *cur, unsigned int newval, unsigned int mask);
569 
570  /* Enable all FP exceptions except _EM_INEXACT, which gdi32 can trigger */
571  hmsvcrt = LoadLibraryA("msvcrt");
572  _controlfp_s = (void*)GetProcAddress(hmsvcrt, "_controlfp_s");
573  if (_controlfp_s) _controlfp_s(0, 0, 0x0008001e);
574 
575  gdiplusStartupInput.GdiplusVersion = 1;
576  gdiplusStartupInput.DebugEventCallback = NULL;
577  gdiplusStartupInput.SuppressBackgroundThread = 0;
578  gdiplusStartupInput.SuppressExternalCodecs = 0;
579 
580  GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
581 
583  test_hascurve();
584  test_nextmarker();
587  test_isvalid();
591 
593 }
static void test_hascurve(void)
Definition: pathiterator.c:57
static void test_getsubpathcount(void)
Definition: pathiterator.c:262
static void test_nextsubpathpath(void)
Definition: pathiterator.c:349
static void test_nextmarker(void)
Definition: pathiterator.c:97
static void test_constructor_destructor(void)
Definition: pathiterator.c:27
uint32_t ULONG_PTR
Definition: typedefs.h:63
GLenum GLint GLuint mask
Definition: glext.h:6028
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
smooth NULL
Definition: ftsmooth.c:416
static void test_nextsubpath(void)
Definition: pathiterator.c:462
int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask)
Definition: cntrlfp.c:120
static void test_isvalid(void)
Definition: pathiterator.c:305
void WINAPI GdiplusShutdown(ULONG_PTR)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
Definition: gdiplus.c:81
static void test_nextmarkerpath(void)
Definition: pathiterator.c:179
static ULONG_PTR gdiplusToken
Definition: CImage.cpp:79
static void test_nextpathtype(void)
Definition: pathiterator.c:485
#define CDECL
Definition: compat.h:21
#define GetProcAddress(x, y)
Definition: compat.h:410
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ test_constructor_destructor()

static void test_constructor_destructor ( void  )
static

Definition at line 27 of file pathiterator.c.

28 {
29  GpPath *path;
30  GpPathIterator *iter;
31  GpStatus stat;
32 
34  GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
35 
36  /* NULL args */
39  iter = NULL;
40  stat = GdipCreatePathIter(&iter, NULL);
41  expect(Ok, stat);
42  ok(iter != NULL, "Expected iterator to be created\n");
43  GdipDeletePathIter(iter);
48 
49  /* valid args */
50  stat = GdipCreatePathIter(&iter, path);
51  expect(Ok, stat);
52 
53  GdipDeletePathIter(iter);
55 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325

Referenced by START_TEST().

◆ test_getsubpathcount()

static void test_getsubpathcount ( void  )
static

Definition at line 262 of file pathiterator.c.

263 {
264  GpPath *path;
265  GpPathIterator *iter;
266  GpStatus stat;
267  INT count;
268 
269  /* NULL args */
274 
276 
277  /* empty path */
278  GdipCreatePathIter(&iter, path);
280  expect(Ok, stat);
281  expect(0, count);
282  GdipDeletePathIter(iter);
283 
284  GdipAddPathLine(path, 5.0, 5.0, 100.0, 50.0);
285 
286  /* open figure */
287  GdipCreatePathIter(&iter, path);
289  expect(Ok, stat);
290  expect(1, count);
291  GdipDeletePathIter(iter);
292 
293  /* manually start new figure */
295  GdipAddPathLine(path, 50.0, 50.0, 110.0, 40.0);
296  GdipCreatePathIter(&iter, path);
298  expect(Ok, stat);
299  expect(2, count);
300  GdipDeletePathIter(iter);
301 
303 }
GpStatus WINGDIPAPI GdipPathIterGetSubpathCount(GpPathIterator *iterator, INT *count)
Definition: pathiterator.c:127
GLsizei const GLchar ** path
Definition: glext.h:7234
GLuint GLuint GLsizei count
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704
Definition: services.c:325
GpStatus WINGDIPAPI GdipStartPathFigure(GpPath *path)

Referenced by START_TEST().

◆ test_hascurve()

static void test_hascurve ( void  )
static

Definition at line 57 of file pathiterator.c.

58 {
59  GpPath *path;
60  GpPathIterator *iter;
61  GpStatus stat;
62  BOOL hasCurve;
63 
65  GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
66 
67  stat = GdipCreatePathIter(&iter, path);
68  expect(Ok, stat);
69 
70  /* NULL args
71  BOOL out argument is local in wrapper class method,
72  so it always has not-NULL address */
73  stat = GdipPathIterHasCurve(NULL, &hasCurve);
75 
76  /* valid args */
77  stat = GdipPathIterHasCurve(iter, &hasCurve);
78  expect(Ok, stat);
79  expect(FALSE, hasCurve);
80 
81  GdipDeletePathIter(iter);
82 
83  stat = GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
84  expect(Ok, stat);
85 
86  stat = GdipCreatePathIter(&iter, path);
87  expect(Ok, stat);
88 
89  stat = GdipPathIterHasCurve(iter, &hasCurve);
90  expect(Ok, stat);
91  expect(TRUE, hasCurve);
92 
93  GdipDeletePathIter(iter);
95 }
#define TRUE
Definition: types.h:120
GLsizei const GLchar ** path
Definition: glext.h:7234
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
unsigned int BOOL
Definition: ntddk_ex.h:94
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
Definition: services.c:325
GpStatus WINGDIPAPI GdipPathIterHasCurve(GpPathIterator *iterator, BOOL *hasCurve)
Definition: pathiterator.c:107
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height)
Definition: graphicspath.c:583

Referenced by START_TEST().

◆ test_isvalid()

static void test_isvalid ( void  )
static

Definition at line 305 of file pathiterator.c.

306 {
307  GpPath *path;
308  GpPathIterator *iter;
309  GpStatus stat;
310  BOOL isvalid;
311  INT start, end, result;
312 
314 
315  /* NULL args */
316  GdipCreatePathIter(&iter, path);
319  stat = GdipPathIterIsValid(iter, NULL);
321  stat = GdipPathIterIsValid(NULL, &isvalid);
323  GdipDeletePathIter(iter);
324 
325  /* on empty path */
326  GdipCreatePathIter(&iter, path);
327  isvalid = FALSE;
328  stat = GdipPathIterIsValid(iter, &isvalid);
329  expect(Ok, stat);
330  expect(TRUE, isvalid);
331  GdipDeletePathIter(iter);
332 
333  /* no markers */
334  stat = GdipAddPathLine(path, 50.0, 50.0, 110.0, 40.0);
335  expect(Ok, stat);
336  stat = GdipCreatePathIter(&iter, path);
337  expect(Ok, stat);
339  expect(Ok, stat);
340  isvalid = FALSE;
341  stat = GdipPathIterIsValid(iter, &isvalid);
342  expect(Ok, stat);
343  expect(TRUE, isvalid);
344  GdipDeletePathIter(iter);
345 
347 }
#define TRUE
Definition: types.h:120
GLsizei const GLchar ** path
Definition: glext.h:7234
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
unsigned int BOOL
Definition: ntddk_ex.h:94
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipPathIterNextMarker(GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex)
Definition: pathiterator.c:145
GpStatus WINGDIPAPI GdipPathIterIsValid(GpPathIterator *iterator, BOOL *valid)
Definition: pathiterator.c:283
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GLuint start
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704
Definition: services.c:325
GLuint64EXT * result
Definition: glext.h:11304

Referenced by START_TEST().

◆ test_nextmarker()

static void test_nextmarker ( void  )
static

Definition at line 97 of file pathiterator.c.

98 {
99  GpPath *path;
100  GpPathIterator *iter;
101  GpStatus stat;
102  INT start, end;
103  INT result;
104 
105  /* NULL args
106  BOOL out argument is local in wrapper class method,
107  so it always has not-NULL address */
114 
116  GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
117 
118  /* no markers */
119  GdipCreatePathIter(&iter, path);
120  start = end = result = (INT)0xdeadbeef;
122  expect(Ok, stat);
123  expect(0, start);
124  expect(3, end);
125  expect(4, result);
126  start = end = result = (INT)0xdeadbeef;
128  expect(Ok, stat);
129  /* start/end remain unchanged */
130  expect((INT)0xdeadbeef, start);
131  expect((INT)0xdeadbeef, end);
132  expect(0, result);
133  GdipDeletePathIter(iter);
134 
135  /* one marker */
137  GdipCreatePathIter(&iter, path);
138  start = end = result = (INT)0xdeadbeef;
140  expect(Ok, stat);
141  expect(0, start);
142  expect(3, end);
143  expect(4, result);
144  start = end = result = (INT)0xdeadbeef;
146  expect(Ok, stat);
147  expect((INT)0xdeadbeef, start);
148  expect((INT)0xdeadbeef, end);
149  expect(0, result);
150  GdipDeletePathIter(iter);
151 
152  /* two markers */
153  GdipAddPathLine(path, 0.0, 0.0, 10.0, 30.0);
155  GdipCreatePathIter(&iter, path);
156  start = end = result = (INT)0xdeadbeef;
158  expect(Ok, stat);
159  expect(0, start);
160  expect(3, end);
161  expect(4, result);
162  start = end = result = (INT)0xdeadbeef;
164  expect(Ok, stat);
165  expect(4, start);
166  expect(5, end);
167  expect(2, result);
168  start = end = result = (INT)0xdeadbeef;
170  expect(Ok, stat);
171  expect((INT)0xdeadbeef, start);
172  expect((INT)0xdeadbeef, end);
173  expect(0, result);
174  GdipDeletePathIter(iter);
175 
177 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
#define INT
Definition: polytest.cpp:20
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipPathIterNextMarker(GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex)
Definition: pathiterator.c:145
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GLuint start
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704
Definition: services.c:325
GpStatus WINGDIPAPI GdipSetPathMarker(GpPath *path)
GLuint64EXT * result
Definition: glext.h:11304

Referenced by START_TEST().

◆ test_nextmarkerpath()

static void test_nextmarkerpath ( void  )
static

Definition at line 179 of file pathiterator.c.

180 {
181  GpPath *path, *retpath;
182  GpPathIterator *iter;
183  GpStatus stat;
184  INT result, count;
185 
187 
188  /* NULL */
195 
196  GdipAddPathRectangle(path, 5.0, 5.0, 100.0, 50.0);
197 
198  /* no markers */
200  GdipCreatePathIter(&iter, path);
201  result = -1;
202  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
203  expect(Ok, stat);
204  expect(4, result);
205  count = -1;
206  GdipGetPointCount(retpath, &count);
207  expect(4, count);
208  result = -1;
209  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
210  expect(Ok, stat);
211  expect(0, result);
212  count = -1;
213  GdipGetPointCount(retpath, &count);
214  expect(4, count);
215  GdipDeletePathIter(iter);
216  GdipDeletePath(retpath);
217 
218  /* one marker */
221  GdipCreatePathIter(&iter, path);
222  result = -1;
223  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
224  expect(Ok, stat);
225  expect(4, result);
226  count = -1;
227  GdipGetPointCount(retpath, &count);
228  expect(4, count);
229  result = -1;
230  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
231  expect(Ok, stat);
232  expect(0, result);
233  count = -1;
234  GdipGetPointCount(retpath, &count);
235  expect(4, count);
236  GdipDeletePathIter(iter);
237  GdipDeletePath(retpath);
238 
239  /* two markers */
240  GdipAddPathLine(path, 0.0, 0.0, 10.0, 30.0);
243  GdipCreatePathIter(&iter, path);
244  result = -1;
245  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
246  expect(Ok, stat);
247  expect(4, result);
248  result = -1;
249  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
250  expect(Ok, stat);
251  expect(2, result);
252  result = -1;
253  stat = GdipPathIterNextMarkerPath(iter, &result, retpath);
254  expect(Ok, stat);
255  expect(0, result);
256  GdipDeletePathIter(iter);
257  GdipDeletePath(retpath);
258 
260 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GLuint GLuint GLsizei count
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipPathIterNextMarkerPath(GpPathIterator *iterator, INT *result, GpPath *path)
Definition: pathiterator.c:173
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704
Definition: services.c:325
GpStatus WINGDIPAPI GdipSetPathMarker(GpPath *path)
GLuint64EXT * result
Definition: glext.h:11304

Referenced by START_TEST().

◆ test_nextpathtype()

static void test_nextpathtype ( void  )
static

Definition at line 485 of file pathiterator.c.

486 {
487  GpPath *path;
488  GpPathIterator *iter;
489  GpStatus stat;
490  INT start, end, result;
491  BYTE type;
492 
494  GdipCreatePathIter(&iter, path);
495 
496  /* NULL arguments */
511 
512  /* empty path */
513  start = end = result = (INT)0xdeadbeef;
516  expect((INT)0xdeadbeef, start);
517  expect((INT)0xdeadbeef, end);
518  todo_wine expect(0, result);
519  GdipDeletePathIter(iter);
520 
521  /* single figure */
522  GdipAddPathLine(path, 0.0, 0.0, 10.0, 30.0);
523  GdipCreatePathIter(&iter, path);
524  start = end = result = (INT)0xdeadbeef;
525  type = 255; /* out of range */
528  expect((INT)0xdeadbeef, start);
529  expect((INT)0xdeadbeef, end);
530  expect(255, type);
531  todo_wine expect(0, result);
532  GdipDeletePathIter(iter);
533 
534  stat = GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
535  expect(Ok, stat);
536  GdipCreatePathIter(&iter, path);
537  start = end = result = (INT)0xdeadbeef;
538  type = 255; /* out of range */
541  expect((INT)0xdeadbeef, start);
542  expect((INT)0xdeadbeef, end);
543  expect(255, type);
544  todo_wine expect(0, result);
545  GdipDeletePathIter(iter);
546 
547  /* closed */
549  GdipCreatePathIter(&iter, path);
550  start = end = result = (INT)0xdeadbeef;
551  type = 255; /* out of range */
554  expect((INT)0xdeadbeef, start);
555  expect((INT)0xdeadbeef, end);
556  expect(255, type);
557  todo_wine expect(0, result);
558  GdipDeletePathIter(iter);
559 
561 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
#define INT
Definition: polytest.cpp:20
GpStatus WINGDIPAPI GdipPathIterNextPathType(GpPathIterator *iter, INT *result, BYTE *type, INT *start, INT *end)
Definition: pathiterator.c:295
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipClosePathFigure(GpPath *path)
#define todo_wine
Definition: test.h:154
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
unsigned char BYTE
Definition: mem.h:68
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GLuint start
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704
Definition: services.c:325
GLuint64EXT * result
Definition: glext.h:11304
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height)
Definition: graphicspath.c:583

Referenced by START_TEST().

◆ test_nextsubpath()

static void test_nextsubpath ( void  )
static

Definition at line 462 of file pathiterator.c.

463 {
464  GpPath *path;
465  GpPathIterator *iter;
466  GpStatus stat;
467  INT start, end, result;
468  BOOL closed;
469 
470  /* empty path */
472  GdipCreatePathIter(&iter, path);
473 
474  result = -2;
475  closed = TRUE;
476  stat = GdipPathIterNextSubpath(iter, &result, &start, &end, &closed);
477  expect(Ok, stat);
478  expect(0, result);
479  expect(TRUE, closed);
480 
481  GdipDeletePathIter(iter);
483 }
#define TRUE
Definition: types.h:120
GLsizei const GLchar ** path
Definition: glext.h:7234
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
unsigned int BOOL
Definition: ntddk_ex.h:94
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex, BOOL *isClosed)
Definition: pathiterator.c:199
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GLuint start
Definition: gl.h:1545
Definition: services.c:325
GLuint64EXT * result
Definition: glext.h:11304

Referenced by START_TEST().

◆ test_nextsubpathpath()

static void test_nextsubpathpath ( void  )
static

Definition at line 349 of file pathiterator.c.

350 {
351  GpPath *path, *retpath;
352  GpPathIterator *iter;
353  GpStatus stat;
354  BOOL closed;
355  INT count, result;
356 
358 
359  /* NULL args */
361  GdipCreatePathIter(&iter, path);
368  stat = GdipPathIterNextSubpathPath(iter, &result, NULL, &closed);
369  expect(Ok, stat);
370  stat = GdipPathIterNextSubpathPath(iter, NULL, NULL, &closed);
372  stat = GdipPathIterNextSubpathPath(iter, NULL, retpath, NULL);
374  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, NULL);
376  GdipDeletePathIter(iter);
377  GdipDeletePath(retpath);
378 
379  /* empty path */
381  GdipCreatePathIter(&iter, path);
382  result = -2;
383  closed = TRUE;
384  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, &closed);
385  expect(Ok, stat);
386  expect(0, result);
387  expect(TRUE, closed);
388  count = -1;
389  GdipGetPointCount(retpath, &count);
390  expect(0, count);
391  GdipDeletePathIter(iter);
392  GdipDeletePath(retpath);
393 
394  /* open figure */
395  GdipAddPathLine(path, 5.0, 5.0, 100.0, 50.0);
396 
398  GdipCreatePathIter(&iter, path);
399  result = -2;
400  closed = TRUE;
401  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, &closed);
402  expect(Ok, stat);
403  expect(2, result);
404  expect(FALSE, closed);
405  count = -1;
406  GdipGetPointCount(retpath, &count);
407  expect(2, count);
408  /* subsequent call */
409  result = -2;
410  closed = TRUE;
411  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, &closed);
412  expect(Ok, stat);
413  expect(0, result);
414  expect(TRUE, closed);
415  count = -1;
416  GdipGetPointCount(retpath, &count);
417  expect(2, count);
418  GdipDeletePathIter(iter);
419 
420  /* closed figure, check does it extend retpath or reset it */
421  GdipAddPathLine(retpath, 50.0, 55.0, 200.0, 150.0);
422 
424  GdipAddPathLine(path, 50.0, 55.0, 200.0, 150.0);
426 
427  GdipCreatePathIter(&iter, path);
428  result = -2;
429  closed = FALSE;
430  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, &closed);
431  expect(Ok, stat);
432  expect(2, result);
433  expect(TRUE, closed);
434  count = -1;
435  GdipGetPointCount(retpath, &count);
436  expect(2, count);
437  /* subsequent call */
438  result = -2;
439  closed = FALSE;
440  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, &closed);
441  expect(Ok, stat);
442  expect(2, result);
443  expect(TRUE, closed);
444  count = -1;
445  GdipGetPointCount(retpath, &count);
446  expect(2, count);
447  result = -2;
448  closed = FALSE;
449  stat = GdipPathIterNextSubpathPath(iter, &result, retpath, &closed);
450  expect(Ok, stat);
451  expect(0, result);
452  expect(TRUE, closed);
453  count = -1;
454  GdipGetPointCount(retpath, &count);
455  expect(2, count);
456  GdipDeletePathIter(iter);
457 
458  GdipDeletePath(retpath);
460 }
GpStatus WINGDIPAPI GdipPathIterNextSubpathPath(GpPathIterator *iter, INT *result, GpPath *path, BOOL *closed)
Definition: pathiterator.c:306
#define TRUE
Definition: types.h:120
GLsizei const GLchar ** path
Definition: glext.h:7234
GLuint GLuint GLsizei count
Definition: gl.h:1545
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath *path)
Definition: pathiterator.c:34
int32_t INT
Definition: typedefs.h:56
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
unsigned int BOOL
Definition: ntddk_ex.h:94
GpStatus WINGDIPAPI GdipDeletePathIter(GpPathIterator *iter)
Definition: pathiterator.c:69
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
GpStatus WINGDIPAPI GdipClosePathFigure(GpPath *path)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
Definition: stat.h:55
Status
Definition: gdiplustypes.h:24
#define expect(expected, got)
Definition: pathiterator.c:25
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704
Definition: services.c:325
GLuint64EXT * result
Definition: glext.h:11304

Referenced by START_TEST().