gdi32/tests: Allow ANSI_CHARSET for some tests.
[wine] / dlls / gdi32 / tests / path.c
1 /*
2  * Unit test suite for paths
3  *
4  * Copyright 2007 Laurent Vromman
5  * Copyright 2007 Misha Koshelev
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include <stdarg.h>
23 #include <stdio.h>
24 #include <assert.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28
29 #include "wine/test.h"
30
31 #include "winuser.h"
32 #include "winerror.h"
33
34 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
35
36 static void test_widenpath(void)
37 {
38     HDC hdc = GetDC(0);
39     HPEN greenPen, narrowPen;
40     POINT pnt[6];
41     INT nSize, ret;
42
43     /* Create a pen to be used in WidenPath */
44     greenPen = CreatePen(PS_SOLID, 10, RGB(0,0,0));
45     SelectObject(hdc, greenPen);
46
47     /* Prepare a path */
48     pnt[0].x = 100;
49     pnt[0].y = 0;
50     pnt[1].x = 200;
51     pnt[1].y = 0;
52     pnt[2].x = 300;
53     pnt[2].y = 100;
54     pnt[3].x = 300;
55     pnt[3].y = 200;
56     pnt[4].x = 200;
57     pnt[4].y = 300;
58     pnt[5].x = 100;
59     pnt[5].y = 300;
60
61     /* Set a polyline path */
62     BeginPath(hdc);
63     Polyline(hdc, pnt, 6);
64     EndPath(hdc);
65
66     /* Widen the polyline path */
67     ok(WidenPath(hdc), "WidenPath fails while widening a poyline path.\n");
68
69     /* Test if WidenPath seems to have done his job */
70     nSize = GetPath(hdc, NULL, NULL, 0);
71     ok(nSize != -1, "GetPath fails after calling WidenPath.\n");
72     ok(nSize > 6, "Path number of points is too low. Should be more than 6 but is %d\n", nSize);
73
74     AbortPath(hdc);
75
76     /* Test WidenPath with an open path (last error only set on Win2k and later) */
77     SetLastError(0xdeadbeef);
78     BeginPath(hdc);
79     ret = WidenPath(hdc);
80     ok(ret == FALSE && (GetLastError() == ERROR_CAN_NOT_COMPLETE || GetLastError() == 0xdeadbeef),
81        "WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %u\n", ret, FALSE, GetLastError());
82
83     AbortPath(hdc);
84
85     /* Test when the pen width is equal to 1. The path should change too */
86     narrowPen = CreatePen(PS_SOLID, 1, RGB(0,0,0));
87     SelectObject(hdc, narrowPen);
88     BeginPath(hdc);
89     Polyline(hdc, pnt, 6);
90     EndPath(hdc);
91     ret = WidenPath(hdc);
92     nSize = GetPath(hdc, NULL, NULL, 0);
93     ok(nSize > 6, "WidenPath should compute a widdened path with a 1px wide pen. Path length is %d, should be more than 6\n", nSize);
94
95     ReleaseDC(0, hdc);
96     return;
97 }
98
99 /*
100  * Tests for GDI drawing functions in paths
101  */
102
103 typedef struct
104 {
105     int x, y;
106     BYTE type;
107
108     /* How many extra entries before this one only on wine
109      * but not on native? */
110     int wine_only_entries_preceding;
111
112     /* 0 - This entry matches on wine.
113      * 1 - This entry corresponds to a single entry on wine that does not match the native entry.
114      * 2 - This entry is currently skipped on wine but present on native. */
115     int todo;
116 } path_test_t;
117
118 /* Helper function to verify that the current path in the given DC matches the expected path.
119  *
120  * We use a "smart" matching algorithm that allows us to detect partial improvements
121  * in conformance. Specifically, two running indices are kept, one through the actual
122  * path and one through the expected path. The actual path index increases unless there is
123  * no match and the todo field of the appropriate path_test_t element is 2. Similarly,
124  * if the wine_entries_preceding field of the appropriate path_test_t element is non-zero,
125  * the expected path index does not increase for that many elements as long as there
126  * is no match. This allows us to todo_wine extra path elements that are present only
127  * on wine but not on native and vice versa.
128  *
129  * Note that if expected_size is zero and the WINETEST_DEBUG environment variable is
130  * greater than 2, the trace() output is a C path_test_t array structure, useful for making
131  * new tests that use this function.
132  */
133 static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, int expected_size, BOOL todo_size)
134 {
135     static const char *type_string[8] = { "Unknown (0)", "PT_CLOSEFIGURE", "PT_LINETO",
136                                           "PT_LINETO | PT_CLOSEFIGURE", "PT_BEZIERTO",
137                                           "PT_BEZIERTO | PT_CLOSEFIGURE", "PT_MOVETO", "PT_MOVETO | PT_CLOSEFIGURE"};
138     POINT *pnt = NULL;
139     BYTE *types = NULL;
140     int size, numskip,
141         idx = 0, eidx = 0;
142
143     /* Get the path */
144     assert(hdc != 0);
145     size = GetPath(hdc, NULL, NULL, 0);
146     ok(size > 0, "GetPath returned size %d, last error %d\n", size, GetLastError());
147     if (size <= 0)
148     {
149         skip("Cannot perform path comparisons due to failure to retrieve path.\n");
150         return;
151     }
152     pnt = HeapAlloc(GetProcessHeap(), 0, size*sizeof(POINT));
153     assert(pnt != 0);
154     types = HeapAlloc(GetProcessHeap(), 0, size*sizeof(BYTE));
155     assert(types != 0);
156     size = GetPath(hdc, pnt, types, size);
157     assert(size > 0);
158
159     if (todo_size) todo_wine
160         ok(size == expected_size, "Path size %d does not match expected size %d\n", size, expected_size);
161     else
162         ok(size == expected_size, "Path size %d does not match expected size %d\n", size, expected_size);
163
164     if (winetest_debug > 2)
165         trace("static const path_test_t %s[] = {\n", path_name);
166
167     numskip = expected_size ? expected[eidx].wine_only_entries_preceding : 0;
168     while (idx < size && eidx < expected_size)
169     {
170         /* We allow a few pixels fudge in matching X and Y coordinates to account for imprecision in
171          * floating point to integer conversion */
172         BOOL match = (types[idx] == expected[eidx].type) &&
173             (pnt[idx].x >= expected[eidx].x-2 && pnt[idx].x <= expected[eidx].x+2) &&
174             (pnt[idx].y >= expected[eidx].y-2 && pnt[idx].y <= expected[eidx].y+2);
175
176         if (expected[eidx].todo || numskip) todo_wine
177             ok(match, "Expected #%d: %s (%d,%d) but got %s (%d,%d)\n", eidx,
178                type_string[expected[eidx].type], expected[eidx].x, expected[eidx].y,
179                type_string[types[idx]], pnt[idx].x, pnt[idx].y);
180         else
181             ok(match, "Expected #%d: %s (%d,%d) but got %s (%d,%d)\n", eidx,
182                type_string[expected[eidx].type], expected[eidx].x, expected[eidx].y,
183                type_string[types[idx]], pnt[idx].x, pnt[idx].y);
184
185         if (match || expected[eidx].todo != 2)
186         {
187             if (winetest_debug > 2)
188                 trace("    {%d, %d, %s, 0, 0}%s /* %d */\n", pnt[idx].x, pnt[idx].y,
189                       type_string[types[idx]], idx < size-1 ? "," : "};", idx);
190             idx++;
191         }
192         if (match || !numskip--)
193             numskip = expected[++eidx].wine_only_entries_preceding;
194     }
195
196     /* If we are debugging and the actual path is longer than the expected path, make
197      * sure to display the entire path */
198     if (winetest_debug > 2 && idx < size)
199         for (; idx < size; idx++)
200             trace("    {%d, %d, %s, 0, 0}%s /* %d */\n", pnt[idx].x, pnt[idx].y,
201                   type_string[types[idx]], idx < size-1 ? "," : "};", idx);
202
203     HeapFree(GetProcessHeap(), 0, types);
204     HeapFree(GetProcessHeap(), 0, pnt);
205 }
206
207 static const path_test_t arcto_path[] = {
208     {0, 0, PT_MOVETO, 0, 0}, /* 0 */
209     {229, 215, PT_LINETO, 0, 0}, /* 1 */
210     {248, 205, PT_BEZIERTO, 0, 0}, /* 2 */
211     {273, 200, PT_BEZIERTO, 0, 0}, /* 3 */
212     {300, 200, PT_BEZIERTO, 0, 0}, /* 4 */
213     {355, 200, PT_BEZIERTO, 0, 0}, /* 5 */
214     {399, 222, PT_BEZIERTO, 0, 0}, /* 6 */
215     {399, 250, PT_BEZIERTO, 0, 0}, /* 7 */
216     {399, 263, PT_BEZIERTO, 0, 0}, /* 8 */
217     {389, 275, PT_BEZIERTO, 0, 0}, /* 9 */
218     {370, 285, PT_BEZIERTO, 0, 0}, /* 10 */
219     {363, 277, PT_LINETO, 0, 0}, /* 11 */
220     {380, 270, PT_BEZIERTO, 0, 0}, /* 12 */
221     {389, 260, PT_BEZIERTO, 0, 0}, /* 13 */
222     {389, 250, PT_BEZIERTO, 0, 0}, /* 14 */
223     {389, 228, PT_BEZIERTO, 0, 0}, /* 15 */
224     {349, 210, PT_BEZIERTO, 0, 0}, /* 16 */
225     {300, 210, PT_BEZIERTO, 0, 0}, /* 17 */
226     {276, 210, PT_BEZIERTO, 0, 0}, /* 18 */
227     {253, 214, PT_BEZIERTO, 0, 0}, /* 19 */
228     {236, 222, PT_BEZIERTO | PT_CLOSEFIGURE, 0, 0}}; /* 20 */
229
230 static void test_arcto(void)
231 {
232     HDC hdc = GetDC(0);
233
234     BeginPath(hdc);
235     SetArcDirection(hdc, AD_CLOCKWISE);
236     if (!ArcTo(hdc, 200, 200, 400, 300, 200, 200, 400, 300) &&
237         GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
238     {
239         /* ArcTo is only available on Win2k and later */
240         win_skip("ArcTo is not available\n");
241         goto done;
242     }
243     SetArcDirection(hdc, AD_COUNTERCLOCKWISE);
244     ArcTo(hdc, 210, 210, 390, 290, 390, 290, 210, 210);
245     CloseFigure(hdc);
246     EndPath(hdc);
247
248     ok_path(hdc, "arcto_path", arcto_path, sizeof(arcto_path)/sizeof(path_test_t), 0);
249 done:
250     ReleaseDC(0, hdc);
251 }
252
253 static const path_test_t anglearc_path[] = {
254     {0, 0, PT_MOVETO, 0, 0}, /* 0 */
255     {371, 229, PT_LINETO, 0, 0}, /* 1 */
256     {352, 211, PT_BEZIERTO, 0, 0}, /* 2 */
257     {327, 200, PT_BEZIERTO, 0, 0}, /* 3 */
258     {300, 200, PT_BEZIERTO, 0, 0}, /* 4 */
259     {245, 200, PT_BEZIERTO, 0, 0}, /* 5 */
260     {200, 245, PT_BEZIERTO, 0, 0}, /* 6 */
261     {200, 300, PT_BEZIERTO, 0, 0}, /* 7 */
262     {200, 300, PT_BEZIERTO, 0, 0}, /* 8 */
263     {200, 300, PT_BEZIERTO, 0, 0}, /* 9 */
264     {200, 300, PT_BEZIERTO, 0, 0}, /* 10 */
265     {231, 260, PT_LINETO, 0, 0}, /* 11 */
266     {245, 235, PT_BEZIERTO, 0, 0}, /* 12 */
267     {271, 220, PT_BEZIERTO, 0, 0}, /* 13 */
268     {300, 220, PT_BEZIERTO, 0, 0}, /* 14 */
269     {344, 220, PT_BEZIERTO, 0, 0}, /* 15 */
270     {380, 256, PT_BEZIERTO, 0, 0}, /* 16 */
271     {380, 300, PT_BEZIERTO, 0, 0}, /* 17 */
272     {380, 314, PT_BEZIERTO, 0, 0}, /* 18 */
273     {376, 328, PT_BEZIERTO, 0, 0}, /* 19 */
274     {369, 340, PT_BEZIERTO | PT_CLOSEFIGURE, 0, 0}}; /* 20 */
275
276 static void test_anglearc(void)
277 {
278     HDC hdc = GetDC(0);
279     BeginPath(hdc);
280     if (!AngleArc(hdc, 300, 300, 100, 45.0, 135.0) &&
281         GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
282     {
283         /* AngleArc is only available on Win2k and later */
284         win_skip("AngleArc is not available\n");
285         goto done;
286     }
287     AngleArc(hdc, 300, 300, 80, 150.0, -180.0);
288     CloseFigure(hdc);
289     EndPath(hdc);
290
291     ok_path(hdc, "anglearc_path", anglearc_path, sizeof(anglearc_path)/sizeof(path_test_t), 0);
292 done:
293     ReleaseDC(0, hdc);
294 }
295
296 static const path_test_t polydraw_path[] = {
297     {0, 0, PT_MOVETO, 0, 0}, /*0*/
298     {10, 10, PT_LINETO, 0, 0}, /*1*/
299     {10, 15, PT_LINETO | PT_CLOSEFIGURE, 0, 0}, /*2*/
300     {100, 100, PT_MOVETO, 0, 0}, /*3*/
301     {95, 95, PT_LINETO, 0, 0}, /*4*/
302     {10, 10, PT_LINETO, 0, 0}, /*5*/
303     {10, 15, PT_LINETO | PT_CLOSEFIGURE, 0, 0}, /*6*/
304     {100, 100, PT_MOVETO, 0, 0}, /*7*/
305     {15, 15, PT_LINETO, 0, 0}, /*8*/
306     {25, 25, PT_MOVETO, 0, 0}, /*9*/
307     {25, 30, PT_LINETO, 0, 0}, /*10*/
308     {100, 100, PT_MOVETO, 0, 0}, /*11*/
309     {30, 30, PT_BEZIERTO, 0, 0}, /*12*/
310     {30, 35, PT_BEZIERTO, 0, 0}, /*13*/
311     {35, 35, PT_BEZIERTO, 0, 0}, /*14*/
312     {35, 40, PT_LINETO, 0, 0}, /*15*/
313     {40, 40, PT_MOVETO, 0, 0}, /*16*/
314     {40, 45, PT_LINETO, 0, 0}, /*17*/
315     {35, 40, PT_MOVETO, 0, 0}, /*18*/
316     {45, 50, PT_LINETO, 0, 0}, /*19*/
317     {35, 40, PT_MOVETO, 0, 0}, /*20*/
318     {50, 55, PT_LINETO, 0, 0}, /*21*/
319     {45, 50, PT_LINETO, 0, 0}, /*22*/
320     {35, 40, PT_MOVETO, 0, 0}, /*23*/
321     {60, 60, PT_LINETO, 0, 0}, /*24*/
322     {60, 65, PT_MOVETO, 0, 0}, /*25*/
323     {65, 65, PT_LINETO, 0, 0} /*26*/
324     };
325
326 static POINT polydraw_pts[] = {
327     {10, 10}, {10, 15},
328     {15, 15}, {15, 20}, {20, 20}, {20, 25},
329     {25, 25}, {25, 30},
330     {30, 30}, {30, 35}, {35, 35}, {35, 40},
331     {40, 40}, {40, 45}, {45, 45},
332     {45, 50}, {50, 50},
333     {50, 55}, {45, 50}, {55, 60},
334     {60, 60}, {60, 65}, {65, 65}};
335
336 static BYTE polydraw_tps[] =
337     {PT_LINETO, PT_CLOSEFIGURE | PT_LINETO, /* 2 */
338      PT_LINETO, PT_BEZIERTO, PT_LINETO, PT_LINETO, /* 6 */
339      PT_MOVETO, PT_LINETO, /* 8 */
340      PT_BEZIERTO, PT_BEZIERTO, PT_BEZIERTO, PT_LINETO, /* 12 */
341      PT_MOVETO, PT_LINETO, PT_CLOSEFIGURE, /* 15 */
342      PT_LINETO, PT_MOVETO | PT_CLOSEFIGURE, /* 17 */
343      PT_LINETO, PT_LINETO, PT_MOVETO | PT_CLOSEFIGURE, /* 20 */
344      PT_LINETO, PT_MOVETO | PT_LINETO, PT_LINETO}; /* 23 */
345
346 static void test_polydraw(void)
347 {
348     BOOL retb;
349     HDC hdc = GetDC(0);
350     BeginPath(hdc);
351
352     /* closefigure with no previous moveto */
353     if (!(retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2)) &&
354         GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
355     {
356         /* PolyDraw is only available on Win2k and later */
357         win_skip("PolyDraw is not available\n");
358         goto done;
359     }
360     expect(TRUE, retb);
361
362     MoveToEx(hdc, 100, 100, NULL);
363     LineTo(hdc, 95, 95);
364     /* closefigure with previous moveto */
365     retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2);
366     expect(TRUE, retb);
367     /* bad bezier points */
368     retb = PolyDraw(hdc, &(polydraw_pts[2]), &(polydraw_tps[2]), 4);
369     expect(FALSE, retb);
370     retb = PolyDraw(hdc, &(polydraw_pts[6]), &(polydraw_tps[6]), 4);
371     expect(FALSE, retb);
372     /* good bezier points */
373     retb = PolyDraw(hdc, &(polydraw_pts[8]), &(polydraw_tps[8]), 4);
374     expect(TRUE, retb);
375     /* does lineto or bezierto take precedence? */
376     retb = PolyDraw(hdc, &(polydraw_pts[12]), &(polydraw_tps[12]), 4);
377     expect(FALSE, retb);
378     /* bad point type, has already moved cursor position */
379     retb = PolyDraw(hdc, &(polydraw_pts[15]), &(polydraw_tps[15]), 4);
380     expect(FALSE, retb);
381     /* bad point type, cursor position is moved, but back to its original spot */
382     retb = PolyDraw(hdc, &(polydraw_pts[17]), &(polydraw_tps[17]), 4);
383     expect(FALSE, retb);
384     /* does lineto or moveto take precedence? */
385     retb = PolyDraw(hdc, &(polydraw_pts[20]), &(polydraw_tps[20]), 3);
386     expect(TRUE, retb);
387
388     EndPath(hdc);
389     ok_path(hdc, "polydraw_path", polydraw_path, sizeof(polydraw_path)/sizeof(path_test_t), 0);
390 done:
391     ReleaseDC(0, hdc);
392 }
393
394 static void test_closefigure(void) {
395     int nSize, nSizeWitness;
396     HDC hdc = GetDC(0);
397
398     BeginPath(hdc);
399     MoveToEx(hdc, 95, 95, NULL);
400     LineTo(hdc, 95,  0);
401     LineTo(hdc,  0, 95);
402
403     CloseFigure(hdc);
404     EndPath(hdc);
405     nSize = GetPath(hdc, NULL, NULL, 0);
406
407     AbortPath(hdc);
408
409     BeginPath(hdc);
410     MoveToEx(hdc, 95, 95, NULL);
411     LineTo(hdc, 95,  0);
412     LineTo(hdc,  0, 95);
413
414     EndPath(hdc);
415     nSizeWitness = GetPath(hdc, NULL, NULL, 0);
416
417     /* This test shows CloseFigure does not have to add a point at the end of the path */
418     ok(nSize == nSizeWitness, "Wrong number of points, no point should be added by CloseFigure\n");
419
420     ReleaseDC(0, hdc);
421 }
422
423 static void WINAPI linedda_callback(INT x, INT y, LPARAM lparam)
424 {
425     POINT **pt = (POINT**)lparam;
426     ok((*pt)->x == x && (*pt)->y == y, "point mismatch expect(%d,%d) got(%d,%d)\n",
427        (*pt)->x, (*pt)->y, x, y);
428
429     (*pt)++;
430     return;
431 }
432
433 static void test_linedda(void)
434 {
435     const POINT *pt;
436     static const POINT array_10_20_20_40[] = {{10,20},{10,21},{11,22},{11,23},
437                                               {12,24},{12,25},{13,26},{13,27},
438                                               {14,28},{14,29},{15,30},{15,31},
439                                               {16,32},{16,33},{17,34},{17,35},
440                                               {18,36},{18,37},{19,38},{19,39},
441                                               {-1,-1}};
442     static const POINT array_10_20_20_43[] = {{10,20},{10,21},{11,22},{11,23},
443                                               {12,24},{12,25},{13,26},{13,27},
444                                               {13,28},{14,29},{14,30},{15,31},
445                                               {15,32},{16,33},{16,34},{17,35},
446                                               {17,36},{17,37},{18,38},{18,39},
447                                               {19,40},{19,41},{20,42},{-1,-1}};
448
449     static const POINT array_10_20_10_20[] = {{-1,-1}};
450     static const POINT array_10_20_11_27[] = {{10,20},{10,21},{10,22},{10,23},
451                                               {11,24},{11,25},{11,26},{-1,-1}};
452
453     static const POINT array_20_43_10_20[] = {{20,43},{20,42},{19,41},{19,40},
454                                               {18,39},{18,38},{17,37},{17,36},
455                                               {17,35},{16,34},{16,33},{15,32},
456                                               {15,31},{14,30},{14,29},{13,28},
457                                               {13,27},{13,26},{12,25},{12,24},
458                                               {11,23},{11,22},{10,21},{-1,-1}};
459
460     static const POINT array_20_20_10_43[] = {{20,20},{20,21},{19,22},{19,23},
461                                               {18,24},{18,25},{17,26},{17,27},
462                                               {17,28},{16,29},{16,30},{15,31},
463                                               {15,32},{14,33},{14,34},{13,35},
464                                               {13,36},{13,37},{12,38},{12,39},
465                                               {11,40},{11,41},{10,42},{-1,-1}};
466
467     static const POINT array_20_20_43_10[] = {{20,20},{21,20},{22,19},{23,19},
468                                               {24,18},{25,18},{26,17},{27,17},
469                                               {28,17},{29,16},{30,16},{31,15},
470                                               {32,15},{33,14},{34,14},{35,13},
471                                               {36,13},{37,13},{38,12},{39,12},
472                                               {40,11},{41,11},{42,10},{-1,-1}};
473
474
475     pt = array_10_20_20_40;
476     LineDDA(10, 20, 20, 40, linedda_callback, (LPARAM)&pt);
477     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
478
479     pt = array_10_20_20_43;
480     LineDDA(10, 20, 20, 43, linedda_callback, (LPARAM)&pt);
481     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
482
483     pt = array_10_20_10_20;
484     LineDDA(10, 20, 10, 20, linedda_callback, (LPARAM)&pt);
485     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
486
487     pt = array_10_20_11_27;
488     LineDDA(10, 20, 11, 27, linedda_callback, (LPARAM)&pt);
489     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
490
491     pt = array_20_43_10_20;
492     LineDDA(20, 43, 10, 20, linedda_callback, (LPARAM)&pt);
493     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
494
495     pt = array_20_20_10_43;
496     LineDDA(20, 20, 10, 43, linedda_callback, (LPARAM)&pt);
497     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
498
499     pt = array_20_20_43_10;
500     LineDDA(20, 20, 43, 10, linedda_callback, (LPARAM)&pt);
501     ok(pt->x == -1 && pt->y == -1, "didn't find terminator\n");
502 }
503
504 START_TEST(path)
505 {
506     test_widenpath();
507     test_arcto();
508     test_anglearc();
509     test_polydraw();
510     test_closefigure();
511     test_linedda();
512 }