Huw Davies : user32/tests: Add tests for setting and getting the background brush.
Module: wine Branch: master Commit: 14f7fd4e23a714849bcf269d0e7d01bf62f4c060 URL: http://source.winehq.org/git/wine.git/?a=commit;h=14f7fd4e23a714849bcf269d0e... Author: Huw Davies <huw(a)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);
participants (1)
-
Alexandre Julliard