225379c0bce88a7ee8270b0806d9aefae5c8ebe7
2 Test_SetDCPenColor(PTESTINFO pti
)
6 // Test an incorrect DC
7 SetLastError(ERROR_SUCCESS
);
8 RTEST(SetDCPenColor(0, RGB(0,0,0)) == CLR_INVALID
);
9 TEST(GetLastError() == ERROR_INVALID_PARAMETER
);
12 hScreenDC
= GetDC(NULL
);
13 if (hScreenDC
== NULL
) return FALSE
;
16 SetDCPenColor(hScreenDC
, RGB(1,2,3));
17 TEST(SetDCPenColor(hScreenDC
, RGB(4,5,6)) == RGB(1,2,3));
20 hDC
= CreateCompatibleDC(hScreenDC
);
21 ReleaseDC(0, hScreenDC
);
27 // Select the DC_PEN and check if the pen returned by a new call is DC_PEN
28 SelectObject(hDC
, GetStockObject(DC_PEN
));
29 TEST(SelectObject(hDC
, GetStockObject(BLACK_PEN
)) == GetStockObject(DC_PEN
));
31 // Test an incorrect color, yes windows sets the color!
32 SetDCPenColor(hDC
, 0x21123456);
33 TEST(SetDCPenColor(hDC
, RGB(0,0,0)) == 0x21123456);
35 // Test CLR_INVALID, it sets CLR_INVALID!
36 SetDCPenColor(hDC
, CLR_INVALID
);
37 RTEST(SetDCPenColor(hDC
, RGB(0,0,0)) == CLR_INVALID
);
42 return APISTATUS_NORMAL
;