jscript: Fix typos in comments, add missing ones.
[wine] / dlls / gdiplus / tests / graphics.c
1 /*
2  * Unit test suite for graphics objects
3  *
4  * Copyright (C) 2007 Google (Evan Stade)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "windows.h"
22 #include "gdiplus.h"
23 #include "wingdi.h"
24 #include "wine/test.h"
25 #include <math.h>
26
27 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
28 #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
29 #define TABLE_LEN (23)
30
31 static void test_constructor_destructor(void)
32 {
33     GpStatus stat;
34     GpGraphics *graphics = NULL;
35     HDC hdc = GetDC(0);
36
37     stat = GdipCreateFromHDC(NULL, &graphics);
38     expect(OutOfMemory, stat);
39     stat = GdipDeleteGraphics(graphics);
40     expect(InvalidParameter, stat);
41
42     stat = GdipCreateFromHDC(hdc, &graphics);
43     expect(Ok, stat);
44     stat = GdipDeleteGraphics(graphics);
45     expect(Ok, stat);
46
47     stat = GdipCreateFromHWND(NULL, &graphics);
48     expect(Ok, stat);
49     stat = GdipDeleteGraphics(graphics);
50     expect(Ok, stat);
51
52     stat = GdipCreateFromHWNDICM(NULL, &graphics);
53     expect(Ok, stat);
54     stat = GdipDeleteGraphics(graphics);
55     expect(Ok, stat);
56
57     stat = GdipDeleteGraphics(NULL);
58     expect(InvalidParameter, stat);
59     ReleaseDC(0, hdc);
60 }
61
62 typedef struct node{
63     GraphicsState data;
64     struct node * next;
65 } node;
66
67 /* Linked list prepend function. */
68 static void log_state(GraphicsState data, node ** log)
69 {
70     node * new_entry = HeapAlloc(GetProcessHeap(), 0, sizeof(node));
71
72     new_entry->data = data;
73     new_entry->next = *log;
74     *log = new_entry;
75 }
76
77 /* Checks if there are duplicates in the list, and frees it. */
78 static void check_no_duplicates(node * log)
79 {
80     INT dups = 0;
81     node * temp = NULL;
82     node * temp2 = NULL;
83     node * orig = log;
84
85     if(!log)
86         goto end;
87
88     do{
89         temp = log;
90         while((temp = temp->next)){
91             if(log->data == temp->data){
92                 dups++;
93                 break;
94             }
95             if(dups > 0)
96                 break;
97         }
98     }while((log = log->next));
99
100     temp = orig;
101     do{
102         temp2 = temp->next;
103         HeapFree(GetProcessHeap(), 0, temp);
104         temp = temp2;
105     }while(temp);
106
107 end:
108     expect(0, dups);
109 }
110
111 static void test_save_restore(void)
112 {
113     GpStatus stat;
114     GraphicsState state_a, state_b, state_c;
115     InterpolationMode mode;
116     GpGraphics *graphics1, *graphics2;
117     node * state_log = NULL;
118     HDC hdc = GetDC(0);
119     state_a = state_b = state_c = 0xdeadbeef;
120
121     /* Invalid saving. */
122     GdipCreateFromHDC(hdc, &graphics1);
123     stat = GdipSaveGraphics(graphics1, NULL);
124     expect(InvalidParameter, stat);
125     stat = GdipSaveGraphics(NULL, &state_a);
126     expect(InvalidParameter, stat);
127     GdipDeleteGraphics(graphics1);
128
129     log_state(state_a, &state_log);
130
131     /* Basic save/restore. */
132     GdipCreateFromHDC(hdc, &graphics1);
133     GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
134     stat = GdipSaveGraphics(graphics1, &state_a);
135     expect(Ok, stat);
136     GdipSetInterpolationMode(graphics1, InterpolationModeBicubic);
137     stat = GdipRestoreGraphics(graphics1, state_a);
138     expect(Ok, stat);
139     GdipGetInterpolationMode(graphics1, &mode);
140     todo_wine
141         expect(InterpolationModeBilinear, mode);
142     GdipDeleteGraphics(graphics1);
143
144     log_state(state_a, &state_log);
145
146     /* Restoring garbage doesn't affect saves. */
147     GdipCreateFromHDC(hdc, &graphics1);
148     GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
149     GdipSaveGraphics(graphics1, &state_a);
150     GdipSetInterpolationMode(graphics1, InterpolationModeBicubic);
151     GdipSaveGraphics(graphics1, &state_b);
152     GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
153     stat = GdipRestoreGraphics(graphics1, 0xdeadbeef);
154     expect(Ok, stat);
155     GdipRestoreGraphics(graphics1, state_b);
156     GdipGetInterpolationMode(graphics1, &mode);
157     todo_wine
158         expect(InterpolationModeBicubic, mode);
159     GdipRestoreGraphics(graphics1, state_a);
160     GdipGetInterpolationMode(graphics1, &mode);
161     todo_wine
162         expect(InterpolationModeBilinear, mode);
163     GdipDeleteGraphics(graphics1);
164
165     log_state(state_a, &state_log);
166     log_state(state_b, &state_log);
167
168     /* Restoring older state invalidates newer saves (but not older saves). */
169     GdipCreateFromHDC(hdc, &graphics1);
170     GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
171     GdipSaveGraphics(graphics1, &state_a);
172     GdipSetInterpolationMode(graphics1, InterpolationModeBicubic);
173     GdipSaveGraphics(graphics1, &state_b);
174     GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
175     GdipSaveGraphics(graphics1, &state_c);
176     GdipSetInterpolationMode(graphics1, InterpolationModeHighQualityBilinear);
177     GdipRestoreGraphics(graphics1, state_b);
178     GdipGetInterpolationMode(graphics1, &mode);
179     todo_wine
180         expect(InterpolationModeBicubic, mode);
181     GdipRestoreGraphics(graphics1, state_c);
182     GdipGetInterpolationMode(graphics1, &mode);
183     todo_wine
184         expect(InterpolationModeBicubic, mode);
185     GdipRestoreGraphics(graphics1, state_a);
186     GdipGetInterpolationMode(graphics1, &mode);
187     todo_wine
188         expect(InterpolationModeBilinear, mode);
189     GdipDeleteGraphics(graphics1);
190
191     log_state(state_a, &state_log);
192     log_state(state_b, &state_log);
193     log_state(state_c, &state_log);
194
195     /* Restoring older save from one graphics object does not invalidate
196      * newer save from other graphics object. */
197     GdipCreateFromHDC(hdc, &graphics1);
198     GdipCreateFromHDC(hdc, &graphics2);
199     GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
200     GdipSaveGraphics(graphics1, &state_a);
201     GdipSetInterpolationMode(graphics2, InterpolationModeBicubic);
202     GdipSaveGraphics(graphics2, &state_b);
203     GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
204     GdipSetInterpolationMode(graphics2, InterpolationModeNearestNeighbor);
205     GdipRestoreGraphics(graphics1, state_a);
206     GdipGetInterpolationMode(graphics1, &mode);
207     todo_wine
208         expect(InterpolationModeBilinear, mode);
209     GdipRestoreGraphics(graphics2, state_b);
210     GdipGetInterpolationMode(graphics2, &mode);
211     todo_wine
212         expect(InterpolationModeBicubic, mode);
213     GdipDeleteGraphics(graphics1);
214     GdipDeleteGraphics(graphics2);
215
216     /* You can't restore a state to a graphics object that didn't save it. */
217     GdipCreateFromHDC(hdc, &graphics1);
218     GdipCreateFromHDC(hdc, &graphics2);
219     GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
220     GdipSaveGraphics(graphics1, &state_a);
221     GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
222     GdipSetInterpolationMode(graphics2, InterpolationModeNearestNeighbor);
223     GdipRestoreGraphics(graphics2, state_a);
224     GdipGetInterpolationMode(graphics2, &mode);
225     expect(InterpolationModeNearestNeighbor, mode);
226     GdipDeleteGraphics(graphics1);
227     GdipDeleteGraphics(graphics2);
228
229     log_state(state_a, &state_log);
230
231     /* The same state value should never be returned twice. */
232     todo_wine
233         check_no_duplicates(state_log);
234
235     ReleaseDC(0, hdc);
236 }
237
238 static void test_GdipDrawArc(void)
239 {
240     GpStatus status;
241     GpGraphics *graphics = NULL;
242     GpPen *pen = NULL;
243     HDC hdc = GetDC(0);
244
245     /* make a graphics object and pen object */
246     status = GdipCreateFromHDC(hdc, &graphics);
247     expect(Ok, status);
248     ok(hdc != NULL, "Expected HDC to be initialized\n");
249
250     status = GdipCreateFromHDC(hdc, &graphics);
251     expect(Ok, status);
252     ok(graphics != NULL, "Expected graphics to be initialized\n");
253
254     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
255     expect(Ok, status);
256     ok(pen != NULL, "Expected pen to be initialized\n");
257
258     /* InvalidParameter cases: null graphics, null pen, non-positive width, non-positive height */
259     status = GdipDrawArc(NULL, NULL, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
260     expect(InvalidParameter, status);
261
262     status = GdipDrawArc(graphics, NULL, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
263     expect(InvalidParameter, status);
264
265     status = GdipDrawArc(NULL, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
266     expect(InvalidParameter, status);
267
268     status = GdipDrawArc(graphics, pen, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0);
269     expect(InvalidParameter, status);
270
271     status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
272     expect(InvalidParameter, status);
273
274     /* successful case */
275     status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
276     expect(Ok, status);
277
278     GdipDeletePen(pen);
279     GdipDeleteGraphics(graphics);
280
281     ReleaseDC(0, hdc);
282 }
283
284 static void test_GdipDrawArcI(void)
285 {
286     GpStatus status;
287     GpGraphics *graphics = NULL;
288     GpPen *pen = NULL;
289     HDC hdc = GetDC(0);
290
291     /* make a graphics object and pen object */
292     status = GdipCreateFromHDC(hdc, &graphics);
293     expect(Ok, status);
294     ok(hdc != NULL, "Expected HDC to be initialized\n");
295
296     status = GdipCreateFromHDC(hdc, &graphics);
297     expect(Ok, status);
298     ok(graphics != NULL, "Expected graphics to be initialized\n");
299
300     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
301     expect(Ok, status);
302     ok(pen != NULL, "Expected pen to be initialized\n");
303
304     /* InvalidParameter cases: null graphics, null pen, non-positive width, non-positive height */
305     status = GdipDrawArcI(NULL, NULL, 0, 0, 0, 0, 0, 0);
306     expect(InvalidParameter, status);
307
308     status = GdipDrawArcI(graphics, NULL, 0, 0, 1, 1, 0, 0);
309     expect(InvalidParameter, status);
310
311     status = GdipDrawArcI(NULL, pen, 0, 0, 1, 1, 0, 0);
312     expect(InvalidParameter, status);
313
314     status = GdipDrawArcI(graphics, pen, 0, 0, 1, 0, 0, 0);
315     expect(InvalidParameter, status);
316
317     status = GdipDrawArcI(graphics, pen, 0, 0, 0, 1, 0, 0);
318     expect(InvalidParameter, status);
319
320     /* successful case */
321     status = GdipDrawArcI(graphics, pen, 0, 0, 1, 1, 0, 0);
322     expect(Ok, status);
323
324     GdipDeletePen(pen);
325     GdipDeleteGraphics(graphics);
326
327     ReleaseDC(0, hdc);
328 }
329
330 static void test_GdipDrawBezierI(void)
331 {
332     GpStatus status;
333     GpGraphics *graphics = NULL;
334     GpPen *pen = NULL;
335     HDC hdc = GetDC(0);
336
337     /* make a graphics object and pen object */
338     status = GdipCreateFromHDC(hdc, &graphics);
339     expect(Ok, status);
340     ok(hdc != NULL, "Expected HDC to be initialized\n");
341
342     status = GdipCreateFromHDC(hdc, &graphics);
343     expect(Ok, status);
344     ok(graphics != NULL, "Expected graphics to be initialized\n");
345
346     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
347     expect(Ok, status);
348     ok(pen != NULL, "Expected pen to be initialized\n");
349
350     /* InvalidParameter cases: null graphics, null pen */
351     status = GdipDrawBezierI(NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0);
352     expect(InvalidParameter, status);
353
354     status = GdipDrawBezierI(graphics, NULL, 0, 0, 0, 0, 0, 0, 0, 0);
355     expect(InvalidParameter, status);
356
357     status = GdipDrawBezierI(NULL, pen, 0, 0, 0, 0, 0, 0, 0, 0);
358     expect(InvalidParameter, status);
359
360     /* successful case */
361     status = GdipDrawBezierI(graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0);
362     expect(Ok, status);
363
364     GdipDeletePen(pen);
365     GdipDeleteGraphics(graphics);
366
367     ReleaseDC(0, hdc);
368 }
369
370 static void test_GdipDrawCurve(void)
371 {
372     GpStatus status;
373     GpGraphics *graphics = NULL;
374     GpPen *pen = NULL;
375     HDC hdc = GetDC(0);
376     GpPointF points[3];
377
378     points[0].X = 0;
379     points[0].Y = 0;
380
381     points[1].X = 40;
382     points[1].Y = 20;
383
384     points[2].X = 10;
385     points[2].Y = 40;
386
387     /* make a graphics object and pen object */
388     ok(hdc != NULL, "Expected HDC to be initialized\n");
389
390     status = GdipCreateFromHDC(hdc, &graphics);
391     expect(Ok, status);
392     ok(graphics != NULL, "Expected graphics to be initialized\n");
393
394     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
395     expect(Ok, status);
396     ok(pen != NULL, "Expected pen to be initialized\n");
397
398     /* InvalidParameter cases: null graphics, null pen */
399     status = GdipDrawCurve(NULL, NULL, points, 3);
400     expect(InvalidParameter, status);
401
402     status = GdipDrawCurve(graphics, NULL, points, 3);
403     expect(InvalidParameter, status);
404
405     status = GdipDrawCurve(NULL, pen, points, 3);
406     expect(InvalidParameter, status);
407
408     /* InvalidParameter cases: invalid count */
409     status = GdipDrawCurve(graphics, pen, points, -1);
410     expect(InvalidParameter, status);
411
412     status = GdipDrawCurve(graphics, pen, points, 0);
413     expect(InvalidParameter, status);
414
415     status = GdipDrawCurve(graphics, pen, points, 1);
416     expect(InvalidParameter, status);
417
418     /* Valid test cases */
419     status = GdipDrawCurve(graphics, pen, points, 2);
420     expect(Ok, status);
421
422     status = GdipDrawCurve(graphics, pen, points, 3);
423     expect(Ok, status);
424
425     GdipDeletePen(pen);
426     GdipDeleteGraphics(graphics);
427
428     ReleaseDC(0, hdc);
429 }
430
431 static void test_GdipDrawLineI(void)
432 {
433     GpStatus status;
434     GpGraphics *graphics = NULL;
435     GpPen *pen = NULL;
436     HDC hdc = GetDC(0);
437
438     /* make a graphics object and pen object */
439     status = GdipCreateFromHDC(hdc, &graphics);
440     expect(Ok, status);
441     ok(hdc != NULL, "Expected HDC to be initialized\n");
442
443     status = GdipCreateFromHDC(hdc, &graphics);
444     expect(Ok, status);
445     ok(graphics != NULL, "Expected graphics to be initialized\n");
446
447     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
448     expect(Ok, status);
449     ok(pen != NULL, "Expected pen to be initialized\n");
450
451     /* InvalidParameter cases: null graphics, null pen */
452     status = GdipDrawLineI(NULL, NULL, 0, 0, 0, 0);
453     expect(InvalidParameter, status);
454
455     status = GdipDrawLineI(graphics, NULL, 0, 0, 0, 0);
456     expect(InvalidParameter, status);
457
458     status = GdipDrawLineI(NULL, pen, 0, 0, 0, 0);
459     expect(InvalidParameter, status);
460
461     /* successful case */
462     status = GdipDrawLineI(graphics, pen, 0, 0, 0, 0);
463     expect(Ok, status);
464
465     GdipDeletePen(pen);
466     GdipDeleteGraphics(graphics);
467
468     ReleaseDC(0, hdc);
469 }
470
471 static void test_GdipDrawLinesI(void)
472 {
473     GpStatus status;
474     GpGraphics *graphics = NULL;
475     GpPen *pen = NULL;
476     GpPoint *ptf = NULL;
477     HDC hdc = GetDC(0);
478
479     /* make a graphics object and pen object */
480     status = GdipCreateFromHDC(hdc, &graphics);
481     expect(Ok, status);
482     ok(hdc != NULL, "Expected HDC to be initialized\n");
483
484     status = GdipCreateFromHDC(hdc, &graphics);
485     expect(Ok, status);
486     ok(graphics != NULL, "Expected graphics to be initialized\n");
487
488     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
489     expect(Ok, status);
490     ok(pen != NULL, "Expected pen to be initialized\n");
491
492     /* make some arbitrary valid points*/
493     ptf = GdipAlloc(2 * sizeof(GpPointF));
494
495     ptf[0].X = 1;
496     ptf[0].Y = 1;
497
498     ptf[1].X = 2;
499     ptf[1].Y = 2;
500
501     /* InvalidParameter cases: null graphics, null pen, null points, count < 2*/
502     status = GdipDrawLinesI(NULL, NULL, NULL, 0);
503     expect(InvalidParameter, status);
504
505     status = GdipDrawLinesI(graphics, pen, ptf, 0);
506     expect(InvalidParameter, status);
507
508     status = GdipDrawLinesI(graphics, NULL, ptf, 2);
509     expect(InvalidParameter, status);
510
511     status = GdipDrawLinesI(NULL, pen, ptf, 2);
512     expect(InvalidParameter, status);
513
514     /* successful case */
515     status = GdipDrawLinesI(graphics, pen, ptf, 2);
516     expect(Ok, status);
517
518     GdipFree(ptf);
519     GdipDeletePen(pen);
520     GdipDeleteGraphics(graphics);
521
522     ReleaseDC(0, hdc);
523 }
524
525 static void test_Get_Release_DC(void)
526 {
527     GpStatus status;
528     GpGraphics *graphics = NULL;
529     GpPen *pen;
530     GpSolidFill *brush;
531     GpPath *path;
532     HDC hdc = GetDC(0);
533     HDC retdc;
534     REAL r;
535     CompositingQuality quality;
536     CompositingMode compmode;
537     InterpolationMode intmode;
538     GpMatrix *m;
539     GpRegion *region;
540     GpUnit unit;
541     PixelOffsetMode offsetmode;
542     SmoothingMode smoothmode;
543     TextRenderingHint texthint;
544     GpPointF ptf[5];
545     GpPoint  pt[5];
546     GpRectF  rectf[2];
547     GpRect   rect[2];
548     GpRegion *clip;
549     INT i;
550     BOOL res;
551     ARGB color = 0x00000000;
552     HRGN hrgn = CreateRectRgn(0, 0, 10, 10);
553
554     pt[0].X = 10;
555     pt[0].Y = 10;
556     pt[1].X = 20;
557     pt[1].Y = 15;
558     pt[2].X = 40;
559     pt[2].Y = 80;
560     pt[3].X = -20;
561     pt[3].Y = 20;
562     pt[4].X = 50;
563     pt[4].Y = 110;
564
565     for(i = 0; i < 5;i++){
566         ptf[i].X = (REAL)pt[i].X;
567         ptf[i].Y = (REAL)pt[i].Y;
568     }
569
570     rect[0].X = 0;
571     rect[0].Y = 0;
572     rect[0].Width  = 50;
573     rect[0].Height = 70;
574     rect[1].X = 0;
575     rect[1].Y = 0;
576     rect[1].Width  = 10;
577     rect[1].Height = 20;
578
579     for(i = 0; i < 2;i++){
580         rectf[i].X = (REAL)rect[i].X;
581         rectf[i].Y = (REAL)rect[i].Y;
582         rectf[i].Height = (REAL)rect[i].Height;
583         rectf[i].Width  = (REAL)rect[i].Width;
584     }
585
586     GdipCreateMatrix(&m);
587     GdipCreateRegion(&region);
588     GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
589     GdipCreatePath(FillModeAlternate, &path);
590     GdipCreateRegion(&clip);
591
592     status = GdipCreateFromHDC(hdc, &graphics);
593     expect(Ok, status);
594     ok(graphics != NULL, "Expected graphics to be initialized\n");
595     status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
596     expect(Ok, status);
597
598     /* NULL arguments */
599     status = GdipGetDC(NULL, NULL);
600     expect(InvalidParameter, status);
601     status = GdipGetDC(graphics, NULL);
602     expect(InvalidParameter, status);
603     status = GdipGetDC(NULL, &retdc);
604     expect(InvalidParameter, status);
605
606     status = GdipReleaseDC(NULL, NULL);
607     expect(InvalidParameter, status);
608     status = GdipReleaseDC(graphics, NULL);
609     expect(InvalidParameter, status);
610     status = GdipReleaseDC(NULL, (HDC)0xdeadbeef);
611     expect(InvalidParameter, status);
612
613     /* Release without Get */
614     status = GdipReleaseDC(graphics, hdc);
615     expect(InvalidParameter, status);
616
617     retdc = NULL;
618     status = GdipGetDC(graphics, &retdc);
619     expect(Ok, status);
620     ok(retdc == hdc, "Invalid HDC returned\n");
621     /* call it once more */
622     status = GdipGetDC(graphics, &retdc);
623     expect(ObjectBusy, status);
624
625     /* try all Graphics calls here */
626     status = Ok;
627     status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
628     expect(ObjectBusy, status); status = Ok;
629     status = GdipDrawArcI(graphics, pen, 0, 0, 1, 1, 0.0, 0.0);
630     expect(ObjectBusy, status); status = Ok;
631     status = GdipDrawBezier(graphics, pen, 0.0, 10.0, 20.0, 15.0, 35.0, -10.0, 10.0, 10.0);
632     expect(ObjectBusy, status); status = Ok;
633     status = GdipDrawBezierI(graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0);
634     expect(ObjectBusy, status); status = Ok;
635     status = GdipDrawBeziers(graphics, pen, ptf, 5);
636     expect(ObjectBusy, status); status = Ok;
637     status = GdipDrawBeziersI(graphics, pen, pt, 5);
638     expect(ObjectBusy, status); status = Ok;
639     status = GdipDrawClosedCurve(graphics, pen, ptf, 5);
640     expect(ObjectBusy, status); status = Ok;
641     status = GdipDrawClosedCurveI(graphics, pen, pt, 5);
642     expect(ObjectBusy, status); status = Ok;
643     status = GdipDrawClosedCurve2(graphics, pen, ptf, 5, 1.0);
644     expect(ObjectBusy, status); status = Ok;
645     status = GdipDrawClosedCurve2I(graphics, pen, pt, 5, 1.0);
646     expect(ObjectBusy, status); status = Ok;
647     status = GdipDrawCurve(graphics, pen, ptf, 5);
648     expect(ObjectBusy, status); status = Ok;
649     status = GdipDrawCurveI(graphics, pen, pt, 5);
650     expect(ObjectBusy, status); status = Ok;
651     status = GdipDrawCurve2(graphics, pen, ptf, 5, 1.0);
652     expect(ObjectBusy, status); status = Ok;
653     status = GdipDrawCurve2I(graphics, pen, pt, 5, 1.0);
654     expect(ObjectBusy, status); status = Ok;
655     status = GdipDrawEllipse(graphics, pen, 0.0, 0.0, 100.0, 50.0);
656     expect(ObjectBusy, status); status = Ok;
657     status = GdipDrawEllipseI(graphics, pen, 0, 0, 100, 50);
658     expect(ObjectBusy, status); status = Ok;
659     /* GdipDrawImage/GdipDrawImageI */
660     /* GdipDrawImagePointsRect/GdipDrawImagePointsRectI */
661     /* GdipDrawImageRectRect/GdipDrawImageRectRectI */
662     /* GdipDrawImageRect/GdipDrawImageRectI */
663     status = GdipDrawLine(graphics, pen, 0.0, 0.0, 100.0, 200.0);
664     expect(ObjectBusy, status); status = Ok;
665     status = GdipDrawLineI(graphics, pen, 0, 0, 100, 200);
666     expect(ObjectBusy, status); status = Ok;
667     status = GdipDrawLines(graphics, pen, ptf, 5);
668     expect(ObjectBusy, status); status = Ok;
669     status = GdipDrawLinesI(graphics, pen, pt, 5);
670     expect(ObjectBusy, status); status = Ok;
671     status = GdipDrawPath(graphics, pen, path);
672     expect(ObjectBusy, status); status = Ok;
673     status = GdipDrawPie(graphics, pen, 0.0, 0.0, 100.0, 100.0, 0.0, 90.0);
674     expect(ObjectBusy, status); status = Ok;
675     status = GdipDrawPieI(graphics, pen, 0, 0, 100, 100, 0.0, 90.0);
676     expect(ObjectBusy, status); status = Ok;
677     status = GdipDrawRectangle(graphics, pen, 0.0, 0.0, 100.0, 300.0);
678     expect(ObjectBusy, status); status = Ok;
679     status = GdipDrawRectangleI(graphics, pen, 0, 0, 100, 300);
680     expect(ObjectBusy, status); status = Ok;
681     status = GdipDrawRectangles(graphics, pen, rectf, 2);
682     expect(ObjectBusy, status); status = Ok;
683     status = GdipDrawRectanglesI(graphics, pen, rect, 2);
684     expect(ObjectBusy, status); status = Ok;
685     /* GdipDrawString */
686     status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, ptf, 5, 1.0, FillModeAlternate);
687     expect(ObjectBusy, status); status = Ok;
688     status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, pt, 5, 1.0, FillModeAlternate);
689     expect(ObjectBusy, status); status = Ok;
690     status = GdipFillEllipse(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0);
691     expect(ObjectBusy, status); status = Ok;
692     status = GdipFillEllipseI(graphics, (GpBrush*)brush, 0, 0, 100, 100);
693     expect(ObjectBusy, status); status = Ok;
694     status = GdipFillPath(graphics, (GpBrush*)brush, path);
695     expect(ObjectBusy, status); status = Ok;
696     status = GdipFillPie(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0, 0.0, 15.0);
697     expect(ObjectBusy, status); status = Ok;
698     status = GdipFillPieI(graphics, (GpBrush*)brush, 0, 0, 100, 100, 0.0, 15.0);
699     expect(ObjectBusy, status); status = Ok;
700     status = GdipFillPolygon(graphics, (GpBrush*)brush, ptf, 5, FillModeAlternate);
701     expect(ObjectBusy, status); status = Ok;
702     status = GdipFillPolygonI(graphics, (GpBrush*)brush, pt, 5, FillModeAlternate);
703     expect(ObjectBusy, status); status = Ok;
704     status = GdipFillPolygon2(graphics, (GpBrush*)brush, ptf, 5);
705     expect(ObjectBusy, status); status = Ok;
706     status = GdipFillPolygon2I(graphics, (GpBrush*)brush, pt, 5);
707     expect(ObjectBusy, status); status = Ok;
708     status = GdipFillRectangle(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0);
709     expect(ObjectBusy, status); status = Ok;
710     status = GdipFillRectangleI(graphics, (GpBrush*)brush, 0, 0, 100, 100);
711     expect(ObjectBusy, status); status = Ok;
712     status = GdipFillRectangles(graphics, (GpBrush*)brush, rectf, 2);
713     expect(ObjectBusy, status); status = Ok;
714     status = GdipFillRectanglesI(graphics, (GpBrush*)brush, rect, 2);
715     expect(ObjectBusy, status); status = Ok;
716     status = GdipFillRegion(graphics, (GpBrush*)brush, region);
717     expect(ObjectBusy, status); status = Ok;
718     status = GdipFlush(graphics, FlushIntentionFlush);
719     expect(ObjectBusy, status); status = Ok;
720     status = GdipGetClipBounds(graphics, rectf);
721     expect(ObjectBusy, status); status = Ok;
722     status = GdipGetClipBoundsI(graphics, rect);
723     expect(ObjectBusy, status); status = Ok;
724     status = GdipGetCompositingMode(graphics, &compmode);
725     expect(ObjectBusy, status); status = Ok;
726     status = GdipGetCompositingQuality(graphics, &quality);
727     expect(ObjectBusy, status); status = Ok;
728     status = GdipGetInterpolationMode(graphics, &intmode);
729     expect(ObjectBusy, status); status = Ok;
730     status = GdipGetNearestColor(graphics, &color);
731     expect(ObjectBusy, status); status = Ok;
732     status = GdipGetPageScale(graphics, &r);
733     expect(ObjectBusy, status); status = Ok;
734     status = GdipGetPageUnit(graphics, &unit);
735     expect(ObjectBusy, status); status = Ok;
736     status = GdipGetPixelOffsetMode(graphics, &offsetmode);
737     expect(ObjectBusy, status); status = Ok;
738     status = GdipGetSmoothingMode(graphics, &smoothmode);
739     expect(ObjectBusy, status); status = Ok;
740     status = GdipGetTextRenderingHint(graphics, &texthint);
741     expect(ObjectBusy, status); status = Ok;
742     status = GdipGetWorldTransform(graphics, m);
743     expect(ObjectBusy, status); status = Ok;
744     status = GdipGraphicsClear(graphics, 0xdeadbeef);
745     expect(ObjectBusy, status); status = Ok;
746     status = GdipIsVisiblePoint(graphics, 0.0, 0.0, &res);
747     expect(ObjectBusy, status); status = Ok;
748     status = GdipIsVisiblePointI(graphics, 0, 0, &res);
749     expect(ObjectBusy, status); status = Ok;
750     /* GdipMeasureCharacterRanges */
751     /* GdipMeasureString */
752     status = GdipResetClip(graphics);
753     expect(ObjectBusy, status); status = Ok;
754     status = GdipResetWorldTransform(graphics);
755     expect(ObjectBusy, status); status = Ok;
756     /* GdipRestoreGraphics */
757     status = GdipRotateWorldTransform(graphics, 15.0, MatrixOrderPrepend);
758     expect(ObjectBusy, status); status = Ok;
759     /*  GdipSaveGraphics */
760     status = GdipScaleWorldTransform(graphics, 1.0, 1.0, MatrixOrderPrepend);
761     expect(ObjectBusy, status); status = Ok;
762     status = GdipSetCompositingMode(graphics, CompositingModeSourceOver);
763     expect(ObjectBusy, status); status = Ok;
764     status = GdipSetCompositingQuality(graphics, CompositingQualityDefault);
765     expect(ObjectBusy, status); status = Ok;
766     status = GdipSetInterpolationMode(graphics, InterpolationModeDefault);
767     expect(ObjectBusy, status); status = Ok;
768     status = GdipSetPageScale(graphics, 1.0);
769     expect(ObjectBusy, status); status = Ok;
770     status = GdipSetPageUnit(graphics, UnitWorld);
771     expect(ObjectBusy, status); status = Ok;
772     status = GdipSetPixelOffsetMode(graphics, PixelOffsetModeDefault);
773     expect(ObjectBusy, status); status = Ok;
774     status = GdipSetSmoothingMode(graphics, SmoothingModeDefault);
775     expect(ObjectBusy, status); status = Ok;
776     status = GdipSetTextRenderingHint(graphics, TextRenderingHintSystemDefault);
777     expect(ObjectBusy, status); status = Ok;
778     status = GdipSetWorldTransform(graphics, m);
779     expect(ObjectBusy, status); status = Ok;
780     status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend);
781     expect(ObjectBusy, status); status = Ok;
782     status = GdipSetClipHrgn(graphics, hrgn, CombineModeReplace);
783     expect(ObjectBusy, status); status = Ok;
784     status = GdipSetClipPath(graphics, path, CombineModeReplace);
785     expect(ObjectBusy, status); status = Ok;
786     status = GdipSetClipRect(graphics, 0.0, 0.0, 10.0, 10.0, CombineModeReplace);
787     expect(ObjectBusy, status); status = Ok;
788     status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace);
789     expect(ObjectBusy, status); status = Ok;
790     status = GdipSetClipRegion(graphics, clip, CombineModeReplace);
791     expect(ObjectBusy, status); status = Ok;
792     status = GdipTranslateClip(graphics, 0.0, 0.0);
793     expect(ObjectBusy, status); status = Ok;
794     status = GdipTranslateClipI(graphics, 0, 0);
795     expect(ObjectBusy, status); status = Ok;
796     status = GdipDrawPolygon(graphics, pen, ptf, 5);
797     expect(ObjectBusy, status); status = Ok;
798     status = GdipDrawPolygonI(graphics, pen, pt, 5);
799     expect(ObjectBusy, status); status = Ok;
800     status = GdipGetDpiX(graphics, &r);
801     expect(ObjectBusy, status); status = Ok;
802     status = GdipGetDpiY(graphics, &r);
803     expect(ObjectBusy, status); status = Ok;
804     status = GdipMultiplyWorldTransform(graphics, m, MatrixOrderPrepend);
805     status = GdipGetClip(graphics, region);
806     expect(ObjectBusy, status); status = Ok;
807     status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, ptf, 5);
808     expect(ObjectBusy, status); status = Ok;
809     /* try to delete before release */
810     status = GdipDeleteGraphics(graphics);
811     expect(ObjectBusy, status);
812
813     status = GdipReleaseDC(graphics, retdc);
814     expect(Ok, status);
815
816     GdipDeletePen(pen);
817     GdipDeleteGraphics(graphics);
818
819     GdipDeletePath(path);
820     GdipDeleteBrush((GpBrush*)brush);
821     GdipDeleteRegion(region);
822     GdipDeleteMatrix(m);
823     DeleteObject(hrgn);
824
825     ReleaseDC(0, hdc);
826 }
827
828 static void test_transformpoints(void)
829 {
830     GpStatus status;
831     GpGraphics *graphics = NULL;
832     HDC hdc = GetDC(0);
833     GpPointF ptf[2];
834     GpPoint pt[2];
835
836     status = GdipCreateFromHDC(hdc, &graphics);
837     expect(Ok, status);
838
839     /* NULL arguments */
840     status = GdipTransformPoints(NULL, CoordinateSpacePage, CoordinateSpaceWorld, NULL, 0);
841     expect(InvalidParameter, status);
842     status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, NULL, 0);
843     expect(InvalidParameter, status);
844     status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, ptf, 0);
845     expect(InvalidParameter, status);
846     status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, ptf, -1);
847     expect(InvalidParameter, status);
848
849     ptf[0].X = 1.0;
850     ptf[0].Y = 0.0;
851     ptf[1].X = 0.0;
852     ptf[1].Y = 1.0;
853     status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, ptf, 2);
854     expect(Ok, status);
855     expectf(1.0, ptf[0].X);
856     expectf(0.0, ptf[0].Y);
857     expectf(0.0, ptf[1].X);
858     expectf(1.0, ptf[1].Y);
859
860     status = GdipTranslateWorldTransform(graphics, 5.0, 5.0, MatrixOrderAppend);
861     expect(Ok, status);
862     status = GdipSetPageUnit(graphics, UnitPixel);
863     expect(Ok, status);
864     status = GdipSetPageScale(graphics, 3.0);
865     expect(Ok, status);
866
867     ptf[0].X = 1.0;
868     ptf[0].Y = 0.0;
869     ptf[1].X = 0.0;
870     ptf[1].Y = 1.0;
871     status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, ptf, 2);
872     expect(Ok, status);
873     expectf(18.0, ptf[0].X);
874     expectf(15.0, ptf[0].Y);
875     expectf(15.0, ptf[1].X);
876     expectf(18.0, ptf[1].Y);
877
878     ptf[0].X = 1.0;
879     ptf[0].Y = 0.0;
880     ptf[1].X = 0.0;
881     ptf[1].Y = 1.0;
882     status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceWorld, ptf, 2);
883     expect(Ok, status);
884     expectf(6.0, ptf[0].X);
885     expectf(5.0, ptf[0].Y);
886     expectf(5.0, ptf[1].X);
887     expectf(6.0, ptf[1].Y);
888
889     ptf[0].X = 1.0;
890     ptf[0].Y = 0.0;
891     ptf[1].X = 0.0;
892     ptf[1].Y = 1.0;
893     status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpacePage, ptf, 2);
894     expect(Ok, status);
895     expectf(3.0, ptf[0].X);
896     expectf(0.0, ptf[0].Y);
897     expectf(0.0, ptf[1].X);
898     expectf(3.0, ptf[1].Y);
899
900     ptf[0].X = 18.0;
901     ptf[0].Y = 15.0;
902     ptf[1].X = 15.0;
903     ptf[1].Y = 18.0;
904     status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice, ptf, 2);
905     expect(Ok, status);
906     expectf(1.0, ptf[0].X);
907     expectf(0.0, ptf[0].Y);
908     expectf(0.0, ptf[1].X);
909     expectf(1.0, ptf[1].Y);
910
911     ptf[0].X = 6.0;
912     ptf[0].Y = 5.0;
913     ptf[1].X = 5.0;
914     ptf[1].Y = 6.0;
915     status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpacePage, ptf, 2);
916     expect(Ok, status);
917     expectf(1.0, ptf[0].X);
918     expectf(0.0, ptf[0].Y);
919     expectf(0.0, ptf[1].X);
920     expectf(1.0, ptf[1].Y);
921
922     ptf[0].X = 3.0;
923     ptf[0].Y = 0.0;
924     ptf[1].X = 0.0;
925     ptf[1].Y = 3.0;
926     status = GdipTransformPoints(graphics, CoordinateSpacePage, CoordinateSpaceDevice, ptf, 2);
927     expect(Ok, status);
928     expectf(1.0, ptf[0].X);
929     expectf(0.0, ptf[0].Y);
930     expectf(0.0, ptf[1].X);
931     expectf(1.0, ptf[1].Y);
932
933     pt[0].X = 1;
934     pt[0].Y = 0;
935     pt[1].X = 0;
936     pt[1].Y = 1;
937     status = GdipTransformPointsI(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 2);
938     expect(Ok, status);
939     expect(18, pt[0].X);
940     expect(15, pt[0].Y);
941     expect(15, pt[1].X);
942     expect(18, pt[1].Y);
943
944     GdipDeleteGraphics(graphics);
945     ReleaseDC(0, hdc);
946 }
947
948 static void test_get_set_clip(void)
949 {
950     GpStatus status;
951     GpGraphics *graphics = NULL;
952     HDC hdc = GetDC(0);
953     GpRegion *clip;
954     GpRectF rect;
955     BOOL res;
956
957     status = GdipCreateFromHDC(hdc, &graphics);
958     expect(Ok, status);
959
960     rect.X = rect.Y = 0.0;
961     rect.Height = rect.Width = 100.0;
962
963     status = GdipCreateRegionRect(&rect, &clip);
964
965     /* NULL arguments */
966     status = GdipGetClip(NULL, NULL);
967     expect(InvalidParameter, status);
968     status = GdipGetClip(graphics, NULL);
969     expect(InvalidParameter, status);
970     status = GdipGetClip(NULL, clip);
971     expect(InvalidParameter, status);
972
973     status = GdipSetClipRegion(NULL, NULL, CombineModeReplace);
974     expect(InvalidParameter, status);
975     status = GdipSetClipRegion(graphics, NULL, CombineModeReplace);
976     expect(InvalidParameter, status);
977
978     status = GdipSetClipPath(NULL, NULL, CombineModeReplace);
979     expect(InvalidParameter, status);
980     status = GdipSetClipPath(graphics, NULL, CombineModeReplace);
981     expect(InvalidParameter, status);
982
983     res = FALSE;
984     status = GdipGetClip(graphics, clip);
985     expect(Ok, status);
986     status = GdipIsInfiniteRegion(clip, graphics, &res);
987     expect(Ok, status);
988     expect(TRUE, res);
989
990     /* remains infinite after reset */
991     res = FALSE;
992     status = GdipResetClip(graphics);
993     expect(Ok, status);
994     status = GdipGetClip(graphics, clip);
995     expect(Ok, status);
996     status = GdipIsInfiniteRegion(clip, graphics, &res);
997     expect(Ok, status);
998     expect(TRUE, res);
999
1000     /* set to empty and then reset to infinite */
1001     status = GdipSetEmpty(clip);
1002     expect(Ok, status);
1003     status = GdipSetClipRegion(graphics, clip, CombineModeReplace);
1004     expect(Ok, status);
1005
1006     status = GdipGetClip(graphics, clip);
1007     expect(Ok, status);
1008     res = FALSE;
1009     status = GdipIsEmptyRegion(clip, graphics, &res);
1010     expect(Ok, status);
1011     expect(TRUE, res);
1012     status = GdipResetClip(graphics);
1013     expect(Ok, status);
1014     status = GdipGetClip(graphics, clip);
1015     expect(Ok, status);
1016     res = FALSE;
1017     status = GdipIsInfiniteRegion(clip, graphics, &res);
1018     expect(Ok, status);
1019     expect(TRUE, res);
1020
1021     GdipDeleteRegion(clip);
1022
1023     GdipDeleteGraphics(graphics);
1024     ReleaseDC(0, hdc);
1025 }
1026
1027 static void test_isempty(void)
1028 {
1029     GpStatus status;
1030     GpGraphics *graphics = NULL;
1031     HDC hdc = GetDC(0);
1032     GpRegion *clip;
1033     BOOL res;
1034
1035     status = GdipCreateFromHDC(hdc, &graphics);
1036     expect(Ok, status);
1037
1038     status = GdipCreateRegion(&clip);
1039     expect(Ok, status);
1040
1041     /* NULL */
1042     status = GdipIsClipEmpty(NULL, NULL);
1043     expect(InvalidParameter, status);
1044     status = GdipIsClipEmpty(graphics, NULL);
1045     expect(InvalidParameter, status);
1046     status = GdipIsClipEmpty(NULL, &res);
1047     expect(InvalidParameter, status);
1048
1049     /* default is infinite */
1050     res = TRUE;
1051     status = GdipIsClipEmpty(graphics, &res);
1052     expect(Ok, status);
1053     expect(FALSE, res);
1054
1055     GdipDeleteRegion(clip);
1056
1057     GdipDeleteGraphics(graphics);
1058     ReleaseDC(0, hdc);
1059 }
1060
1061 static void test_clear(void)
1062 {
1063     GpStatus status;
1064
1065     status = GdipGraphicsClear(NULL, 0xdeadbeef);
1066     expect(InvalidParameter, status);
1067 }
1068
1069 static void test_textcontrast(void)
1070 {
1071     GpStatus status;
1072     HDC hdc = GetDC(0);
1073     GpGraphics *graphics;
1074     UINT contrast;
1075
1076     status = GdipGetTextContrast(NULL, NULL);
1077     expect(InvalidParameter, status);
1078
1079     status = GdipCreateFromHDC(hdc, &graphics);
1080     expect(Ok, status);
1081
1082     status = GdipGetTextContrast(graphics, NULL);
1083     expect(InvalidParameter, status);
1084     status = GdipGetTextContrast(graphics, &contrast);
1085     expect(4, contrast);
1086
1087     GdipDeleteGraphics(graphics);
1088     ReleaseDC(0, hdc);
1089 }
1090
1091 static void test_GdipDrawString(void)
1092 {
1093     GpStatus status;
1094     GpGraphics *graphics = NULL;
1095     GpFont *fnt = NULL;
1096     RectF  rect;
1097     GpStringFormat *format;
1098     GpBrush *brush;
1099     LOGFONTA logfont;
1100     HDC hdc = GetDC(0);
1101     static const WCHAR string[] = {'T','e','s','t',0};
1102
1103     memset(&logfont,0,sizeof(logfont));
1104     strcpy(logfont.lfFaceName,"Arial");
1105     logfont.lfHeight = 12;
1106     logfont.lfCharSet = DEFAULT_CHARSET;
1107
1108     status = GdipCreateFromHDC(hdc, &graphics);
1109     expect(Ok, status);
1110
1111     status = GdipCreateFontFromLogfontA(hdc, &logfont, &fnt);
1112     if (status == FileNotFound)
1113     {
1114         skip("Arial not installed.\n");
1115         return;
1116     }
1117     expect(Ok, status);
1118
1119     status = GdipCreateSolidFill((ARGB)0xdeadbeef, (GpSolidFill**)&brush);
1120     expect(Ok, status);
1121
1122     status = GdipCreateStringFormat(0,0,&format);
1123     expect(Ok, status);
1124
1125     rect.X = 0;
1126     rect.Y = 0;
1127     rect.Width = 0;
1128     rect.Height = 12;
1129
1130     status = GdipDrawString(graphics, string, 4, fnt, &rect, format, brush);
1131     expect(Ok, status);
1132
1133     GdipDeleteGraphics(graphics);
1134     GdipDeleteBrush(brush);
1135     GdipDeleteFont(fnt);
1136     GdipDeleteStringFormat(format);
1137
1138     ReleaseDC(0, hdc);
1139 }
1140
1141
1142 START_TEST(graphics)
1143 {
1144     struct GdiplusStartupInput gdiplusStartupInput;
1145     ULONG_PTR gdiplusToken;
1146
1147     gdiplusStartupInput.GdiplusVersion              = 1;
1148     gdiplusStartupInput.DebugEventCallback          = NULL;
1149     gdiplusStartupInput.SuppressBackgroundThread    = 0;
1150     gdiplusStartupInput.SuppressExternalCodecs      = 0;
1151
1152     GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
1153
1154     test_constructor_destructor();
1155     test_save_restore();
1156     test_GdipDrawBezierI();
1157     test_GdipDrawArc();
1158     test_GdipDrawArcI();
1159     test_GdipDrawCurve();
1160     test_GdipDrawLineI();
1161     test_GdipDrawLinesI();
1162     test_GdipDrawString();
1163     test_Get_Release_DC();
1164     test_transformpoints();
1165     test_get_set_clip();
1166     test_isempty();
1167     test_clear();
1168     test_textcontrast();
1169
1170     GdiplusShutdown(gdiplusToken);
1171 }