[PATCH 1/1] Add tests for invalid index in GetSysColorBrush()

Nikolay Sivov bunglehead at gmail.com
Tue Dec 29 06:48:24 CST 2009


---
 dlls/user32/tests/sysparams.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index dd1e708..a9b79fa 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -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;
-- 
1.5.6.5


--=-d389M+0580ZTDES1mnah--




More information about the wine-patches mailing list