From 5fa90ca910843fa9947f5b85f683300fa211b95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 14 Dec 2007 00:22:40 +0100 Subject: [PATCH] user32: Add a test for EnumDisplaySettings vs GetDeviceCaps. --- dlls/user32/tests/sysparams.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index ecaae3523c0..9e4e6b2d69b 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -2521,6 +2521,36 @@ static void test_GetSystemMetrics( void) ReleaseDC( 0, hdc); } +static void test_EnumDisplaySettings(void) +{ + DEVMODE devmode; + DWORD val; + HDC hdc; + + memset(&devmode, 0, sizeof(devmode)); + devmode.dmSize = sizeof(devmode); + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode); + + hdc = GetDC(0); + val = GetDeviceCaps(hdc, BITSPIXEL); + if(devmode.dmBitsPerPel == 32 && val == 24) { + todo_wine ok(devmode.dmBitsPerPel == val, "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n", + val, devmode.dmBitsPerPel); + } else { + ok(devmode.dmBitsPerPel == val, "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n", + val, devmode.dmBitsPerPel); + } + + val = GetDeviceCaps(hdc, NUMCOLORS); + if(devmode.dmBitsPerPel <= 8) { + ok(val == 256, "Screen bpp is %d, NUMCOLORS returned %d\n", devmode.dmBitsPerPel, val); + } else { + ok(val == -1, "Screen bpp is %d, NUMCOLORS returned %d\n", devmode.dmBitsPerPel, val); + } + + ReleaseDC(0, hdc); +} + START_TEST(sysparams) { int argc; @@ -2545,6 +2575,8 @@ START_TEST(sysparams) trace("testing GetSystemMetrics with your current desktop settings\n"); test_GetSystemMetrics( ); + trace("testing EnumDisplaySettings vs GetDeviceCaps\n"); + test_EnumDisplaySettings( ); change_counter = 0; change_last_param = 0;