Commit 2a0fca79 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 878f2873
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment