mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
cd3af3c4c8
- Add tests for LookupIconIdFromDirectoryEx - Add a workaround in GetIconInfo tests for a ReactOS bug in EnumDisplaySettings - Add tests for EnumDisplaySettings demonstrating the bug. - Add some traces to better follow the test run svn path=/trunk/; revision=60994
60 lines
2.5 KiB
C
60 lines
2.5 KiB
C
#include <apitest.h>
|
|
|
|
#include <wingdi.h>
|
|
#include <winuser.h>
|
|
|
|
#define SIZEOF_DEVMODEW_300 188
|
|
#define SIZEOF_DEVMODEW_400 212
|
|
#define SIZEOF_DEVMODEW_500 220
|
|
|
|
START_TEST(EnumDisplaySettings)
|
|
{
|
|
DEVMODEW dm;
|
|
HDC icDisplay;
|
|
|
|
/* TODO: test with a printer driver */
|
|
|
|
icDisplay = CreateICW(L"DISPLAY", NULL, NULL, NULL);
|
|
ok(icDisplay != NULL, "\n");
|
|
|
|
dm.dmDriverExtra = 0x7777;
|
|
|
|
/* Try ridiculous size */
|
|
dm.dmSize = 0x8888;
|
|
ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &dm), "\n");
|
|
ok(dm.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dm.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
|
|
ok(dm.dmSize == SIZEOF_DEVMODEW_300, "%d\n", dm.dmSize);
|
|
ok(dm.dmDriverExtra == 0, "%d\n", dm.dmDriverExtra);
|
|
|
|
/* Try a tiny size */
|
|
dm.dmSize = 4;
|
|
ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &dm), "\n");
|
|
ok(dm.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dm.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
|
|
ok(dm.dmSize == SIZEOF_DEVMODEW_300, "%d\n", dm.dmSize);
|
|
|
|
/* Something in between */
|
|
dm.dmSize = (SIZEOF_DEVMODEW_300 + SIZEOF_DEVMODEW_400) / 2 ;
|
|
ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &dm), "\n");
|
|
ok(dm.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dm.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
|
|
ok(dm.dmSize == SIZEOF_DEVMODEW_300, "%d\n", dm.dmSize);
|
|
|
|
/* WINVER < 0x0400 */
|
|
dm.dmSize = SIZEOF_DEVMODEW_300;
|
|
ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &dm), "\n");
|
|
ok(dm.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dm.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
|
|
ok(dm.dmSize == SIZEOF_DEVMODEW_300, "%d\n", dm.dmSize);
|
|
|
|
/* WINVER < 0x0500 */
|
|
dm.dmSize = SIZEOF_DEVMODEW_400;
|
|
ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &dm), "\n");
|
|
ok(dm.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dm.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
|
|
ok(dm.dmSize == SIZEOF_DEVMODEW_300, "%d\n", dm.dmSize);
|
|
|
|
/* "Modern" windows */
|
|
dm.dmSize = SIZEOF_DEVMODEW_500;
|
|
ok(EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &dm), "\n");
|
|
ok(dm.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dm.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
|
|
ok(dm.dmSize == SIZEOF_DEVMODEW_300, "%d\n", dm.dmSize);
|
|
|
|
DeleteDC(icDisplay);
|
|
}
|