1 #line 2 "SetDCPenColor.c"
3 #include "../gditest.h"
5 BOOL
Test_SetDCPenColor(INT
* passed
, INT
* failed
)
9 // Test an incorrect DC
10 TEST(SetDCPenColor(0, RGB(0,0,0)) == CLR_INVALID
);
13 hScreenDC
= GetDC(NULL
);
14 if (hScreenDC
== NULL
) return FALSE
;
17 SetDCPenColor(hScreenDC
, RGB(1,2,3));
18 TEST(SetDCPenColor(hScreenDC
, RGB(4,5,6)) == RGB(1,2,3));
21 hDC
= CreateCompatibleDC(hScreenDC
);
22 ReleaseDC(0, hScreenDC
);
28 // Select the DC_PEN and check if the pen returned by a new call is DC_PEN
29 SelectObject(hDC
, GetStockObject(DC_PEN
));
30 TEST(SelectObject(hDC
, GetStockObject(BLACK_PEN
)) == GetStockObject(DC_PEN
));
32 // Test an incorrect color, yes windows sets the color!
33 SetDCPenColor(hDC
, 0x21123456);
34 TEST(SetDCPenColor(hDC
, RGB(0,0,0)) == 0x21123456);
36 // Test CLR_INVALID, it sets CLR_INVALID!
37 SetDCPenColor(hDC
, CLR_INVALID
);
38 TEST(SetDCPenColor(hDC
, RGB(0,0,0)) == CLR_INVALID
);