2007-08-05 03:32:24 +00:00
|
|
|
INT
|
|
|
|
Test_GetStockObject(PTESTINFO pti)
|
|
|
|
{
|
|
|
|
/* Test limits and error */
|
|
|
|
SetLastError(ERROR_SUCCESS);
|
2007-08-07 23:13:25 +00:00
|
|
|
RTEST(GetStockObject(0) != NULL);
|
2007-11-28 23:39:45 +00:00
|
|
|
TEST(GetStockObject(20) != NULL);
|
2007-08-05 03:32:24 +00:00
|
|
|
TEST(GetStockObject(21) != NULL);
|
2007-08-07 23:13:25 +00:00
|
|
|
RTEST(GetStockObject(-1) == NULL);
|
|
|
|
RTEST(GetStockObject(9) == NULL);
|
2007-08-05 23:05:02 +00:00
|
|
|
RTEST(GetStockObject(22) == NULL);
|
|
|
|
RTEST(GetLastError() == ERROR_SUCCESS);
|
2007-08-05 03:32:24 +00:00
|
|
|
|
|
|
|
/* Test for the stock bit */
|
2007-08-05 23:05:02 +00:00
|
|
|
RTEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK);
|
2007-08-05 03:32:24 +00:00
|
|
|
|
|
|
|
/* Test for correct types */
|
2007-11-28 23:39:45 +00:00
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 0 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(LTGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(GRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DKGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); /* 6 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_PEN)) == GDI_OBJECT_TYPE_PEN); /* 7 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_PEN)) == GDI_OBJECT_TYPE_PEN); /* 8 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(OEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 10 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 11 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT); /* 12 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FONT)) == GDI_OBJECT_TYPE_FONT); /* 13 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEVICE_DEFAULT_FONT)) == GDI_OBJECT_TYPE_FONT); /* 14 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); /* 15 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 16 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_GUI_FONT)) == GDI_OBJECT_TYPE_FONT); /* 17 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 18 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); /* 19 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(20)) == GDI_OBJECT_TYPE_COLORSPACE); /* 20 */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(21)) == GDI_OBJECT_TYPE_BITMAP); /* 21 */
|
2007-08-05 03:32:24 +00:00
|
|
|
|
|
|
|
return APISTATUS_NORMAL;
|
|
|
|
}
|