user32/tests: Add tests for invalid index in GetSysColorBrush().

This commit is contained in:
Nikolay Sivov 2009-12-29 15:48:24 +03:00 committed by Alexandre Julliard
parent 878f287366
commit 2a0fca79ae
1 changed files with 22 additions and 0 deletions

View File

@ -2764,6 +2764,27 @@ static void test_EnumDisplaySettings(void)
}
}
static void test_GetSysColorBrush(void)
{
HBRUSH hbr;
SetLastError(0xdeadbeef);
hbr = GetSysColorBrush(-1);
todo_wine ok(hbr == NULL, "Expected NULL brush\n");
ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
/* greater than max index */
hbr = GetSysColorBrush(COLOR_MENUBAR);
if (hbr)
{
SetLastError(0xdeadbeef);
hbr = GetSysColorBrush(COLOR_MENUBAR + 1);
todo_wine ok(hbr == NULL, "Expected NULL brush\n");
ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
}
else
win_skip("COLOR_MENUBAR unsupported\n");
}
START_TEST(sysparams)
{
int argc;
@ -2794,6 +2815,7 @@ START_TEST(sysparams)
test_GetSystemMetrics( );
trace("testing EnumDisplaySettings vs GetDeviceCaps\n");
test_EnumDisplaySettings( );
test_GetSysColorBrush( );
change_counter = 0;
change_last_param = 0;