2 * Unit test suite for pathiterator
4 * Copyright (C) 2008 Nikolay Sivov
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.
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.
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
23 #include "wine/test.h"
25 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
27 static void test_constructor_destructor(void)
33 GdipCreatePath(FillModeAlternate
, &path
);
34 GdipAddPathRectangle(path
, 5.0, 5.0, 100.0, 50.0);
37 stat
= GdipCreatePathIter(NULL
, NULL
);
38 expect(InvalidParameter
, stat
);
39 stat
= GdipCreatePathIter(&iter
, NULL
);
40 expect(InvalidParameter
, stat
);
41 stat
= GdipCreatePathIter(NULL
, path
);
42 expect(InvalidParameter
, stat
);
43 stat
= GdipDeletePathIter(NULL
);
44 expect(InvalidParameter
, stat
);
47 stat
= GdipCreatePathIter(&iter
, path
);
50 GdipDeletePathIter(iter
);
54 static void test_hascurve(void)
61 GdipCreatePath(FillModeAlternate
, &path
);
62 GdipAddPathRectangle(path
, 5.0, 5.0, 100.0, 50.0);
64 stat
= GdipCreatePathIter(&iter
, path
);
68 BOOL out argument is local in wrapper class method,
69 so it always has not-NULL address */
70 stat
= GdipPathIterHasCurve(NULL
, &hasCurve
);
71 expect(InvalidParameter
, stat
);
74 stat
= GdipPathIterHasCurve(iter
, &hasCurve
);
76 expect(FALSE
, hasCurve
);
78 GdipDeletePathIter(iter
);
80 GdipAddPathEllipse(path
, 0.0, 0.0, 35.0, 70.0);
82 stat
= GdipCreatePathIter(&iter
, path
);
85 stat
= GdipPathIterHasCurve(iter
, &hasCurve
);
87 expect(TRUE
, hasCurve
);
89 GdipDeletePathIter(iter
);
93 START_TEST(pathiterator
)
95 struct GdiplusStartupInput gdiplusStartupInput
;
96 ULONG_PTR gdiplusToken
;
98 gdiplusStartupInput
.GdiplusVersion
= 1;
99 gdiplusStartupInput
.DebugEventCallback
= NULL
;
100 gdiplusStartupInput
.SuppressBackgroundThread
= 0;
101 gdiplusStartupInput
.SuppressExternalCodecs
= 0;
103 GdiplusStartup(&gdiplusToken
, &gdiplusStartupInput
, NULL
);
105 test_constructor_destructor();
108 GdiplusShutdown(gdiplusToken
);