2 * Unit test suite for pens (and init)
4 * Copyright (C) 2007 Google (Evan Stade)
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
25 #include "wine/test.h"
27 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
29 static void test_startup(void)
33 struct GdiplusStartupInput gdiplusStartupInput;
34 ULONG_PTR gdiplusToken;
36 gdiplusStartupInput.GdiplusVersion = 1;
37 gdiplusStartupInput.DebugEventCallback = NULL;
38 gdiplusStartupInput.SuppressBackgroundThread = 0;
39 gdiplusStartupInput.SuppressExternalCodecs = 0;
41 status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
43 GdiplusShutdown(gdiplusToken);
45 gdiplusStartupInput.GdiplusVersion = 2;
47 status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
48 expect(UnsupportedGdiplusVersion, status);
49 GdiplusShutdown(gdiplusToken);
51 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
54 expect(GdiplusNotInitialized, status);
59 static void test_constructor_destructor(void)
64 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
66 ok(pen != NULL, "Expected pen to be initialized\n");
68 status = GdipDeletePen(NULL);
69 expect(InvalidParameter, status);
71 status = GdipDeletePen(pen);
77 struct GdiplusStartupInput gdiplusStartupInput;
78 ULONG_PTR gdiplusToken;
82 gdiplusStartupInput.GdiplusVersion = 1;
83 gdiplusStartupInput.DebugEventCallback = NULL;
84 gdiplusStartupInput.SuppressBackgroundThread = 0;
85 gdiplusStartupInput.SuppressExternalCodecs = 0;
87 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
89 test_constructor_destructor();
91 GdiplusShutdown(gdiplusToken);