rpcrt4: Try a lot harder to resuse existing connections by comparing inside the RpcQu...
[wine] / dlls / gdiplus / tests / brush.c
1 /*
2  * Unit test suite for brushes
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 <stdarg.h>
22
23 #include "windef.h"
24 #include "gdiplus.h"
25 #include "wine/test.h"
26
27 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
28
29 static void test_constructor_destructor(void)
30 {
31     GpStatus status;
32     GpSolidFill *brush = NULL;
33
34     status = GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
35     expect(Ok, status);
36     ok(brush != NULL, "Expected brush to be initialized\n");
37
38     status = GdipDeleteBrush(NULL);
39     expect(InvalidParameter, status);
40
41     status = GdipDeleteBrush((GpBrush*) brush);
42     expect(Ok, status);
43 }
44
45 static void test_type(void)
46 {
47     GpStatus status;
48     GpBrushType bt;
49     GpSolidFill *brush = NULL;
50
51     GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
52
53     status = GdipGetBrushType((GpBrush*)brush, &bt);
54     expect(status, Ok);
55     expect(bt, BrushTypeSolidColor);
56
57     GdipDeleteBrush((GpBrush*) brush);
58 }
59
60 START_TEST(brush)
61 {
62     struct GdiplusStartupInput gdiplusStartupInput;
63     ULONG_PTR gdiplusToken;
64
65     gdiplusStartupInput.GdiplusVersion              = 1;
66     gdiplusStartupInput.DebugEventCallback          = NULL;
67     gdiplusStartupInput.SuppressBackgroundThread    = 0;
68     gdiplusStartupInput.SuppressExternalCodecs      = 0;
69
70     GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
71
72     test_constructor_destructor();
73     test_type();
74
75     GdiplusShutdown(gdiplusToken);
76 }