Huw Davies : user32/tests: Add tests for setting and getting the background brush.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Jan 16 14:12:30 CST 2015
Module: wine
Branch: master
Commit: 14f7fd4e23a714849bcf269d0e7d01bf62f4c060
URL: http://source.winehq.org/git/wine.git/?a=commit;h=14f7fd4e23a714849bcf269d0e7d01bf62f4c060
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Jan 16 11:10:38 2015 +0000
user32/tests: Add tests for setting and getting the background brush.
---
dlls/user32/tests/menu.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index 575d786..62c3229 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -2976,6 +2976,7 @@ static void test_menu_setmenuinfo(void)
MENUITEMINFOA mii = { sizeof(MENUITEMINFOA) };
BOOL ret;
DWORD gle;
+ HBRUSH brush;
if (!pGetMenuInfo || !pSetMenuInfo)
{
@@ -3091,6 +3092,31 @@ static void test_menu_setmenuinfo(void)
ok( ret, "GetMenuInfo() should have succeeded\n");
ok( gle == 0xdeadbeef, "GetMenuInfo() error got %u\n", gle);
ok( !(mi.dwStyle & MNS_NOCHECK), "menustyle was not expected to have the MNS_NOCHECK flag\n");
+
+ /* test background brush */
+ mi.cbSize = sizeof(mi);
+ mi.fMask = MIM_BACKGROUND;
+ ret = pGetMenuInfo( hmenu, &mi );
+ ok( ret, "GetMenuInfo() should have succeeded\n" );
+ ok( mi.hbrBack == NULL, "got %p\n", mi.hbrBack );
+
+ brush = CreateSolidBrush( RGB(0xff, 0, 0) );
+ mi.hbrBack = brush;
+ ret = pSetMenuInfo( hmenu, &mi );
+ ok( ret, "SetMenuInfo() should have succeeded\n" );
+ mi.hbrBack = NULL;
+ ret = pGetMenuInfo( hmenu, &mi );
+ ok( ret, "GetMenuInfo() should have succeeded\n" );
+ ok( mi.hbrBack == brush, "got %p original %p\n", mi.hbrBack, brush );
+
+ mi.hbrBack = NULL;
+ ret = pSetMenuInfo( hmenu, &mi );
+ ok( ret, "SetMenuInfo() should have succeeded\n" );
+ ret = pGetMenuInfo( hmenu, &mi );
+ ok( ret, "GetMenuInfo() should have succeeded\n" );
+ ok( mi.hbrBack == NULL, "got %p\n", mi.hbrBack );
+ DeleteObject( brush );
+
/* clean up */
DestroyMenu( hsubmenu);
DestroyMenu( hmenu);
More information about the wine-cvs
mailing list