Fix copy paste error in file header
[reactos.git] / rostests / apitests / gdi32api / tests / CreatePen.c
1 INT
2 Test_CreatePen(PTESTINFO pti)
3 {
4 HPEN hPen;
5 LOGPEN logpen;
6
7 SetLastError(ERROR_SUCCESS);
8 hPen = CreatePen(PS_DASHDOT, 5, RGB(1,2,3));
9 RTEST(hPen);
10
11 /* Test if we have a PEN */
12 RTEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_PEN);
13
14 GetObject(hPen, sizeof(logpen), &logpen);
15 RTEST(logpen.lopnStyle == PS_DASHDOT);
16 RTEST(logpen.lopnWidth.x == 5);
17 RTEST(logpen.lopnColor == RGB(1,2,3));
18 DeleteObject(hPen);
19
20 /* PS_GEOMETRIC | PS_DASHDOT = 0x00001011 will become PS_SOLID */
21 logpen.lopnStyle = 22;
22 hPen = CreatePen(PS_GEOMETRIC | PS_DASHDOT, 5, RGB(1,2,3));
23 RTEST(hPen);
24 GetObject(hPen, sizeof(logpen), &logpen);
25 RTEST(logpen.lopnStyle == PS_SOLID);
26 DeleteObject(hPen);
27
28 /* PS_USERSTYLE will become PS_SOLID */
29 logpen.lopnStyle = 22;
30 hPen = CreatePen(PS_USERSTYLE, 5, RGB(1,2,3));
31 RTEST(hPen);
32 GetObject(hPen, sizeof(logpen), &logpen);
33 RTEST(logpen.lopnStyle == PS_SOLID);
34 DeleteObject(hPen);
35
36 /* PS_ALTERNATE will become PS_SOLID */
37 logpen.lopnStyle = 22;
38 hPen = CreatePen(PS_ALTERNATE, 5, RGB(1,2,3));
39 RTEST(hPen);
40 GetObject(hPen, sizeof(logpen), &logpen);
41 RTEST(logpen.lopnStyle == PS_SOLID);
42 DeleteObject(hPen);
43
44 /* PS_INSIDEFRAME is ok */
45 logpen.lopnStyle = 22;
46 hPen = CreatePen(PS_INSIDEFRAME, 5, RGB(1,2,3));
47 RTEST(hPen);
48 GetObject(hPen, sizeof(logpen), &logpen);
49 RTEST(logpen.lopnStyle == PS_INSIDEFRAME);
50 DeleteObject(hPen);
51
52 RTEST(GetLastError() == ERROR_SUCCESS);
53
54 return APISTATUS_NORMAL;
55 }
56