Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7744c700
Commit
7744c700
authored
Apr 21, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add AppendMenu/ModifyMenu MF_POPUP tests.
parent
fe3f1233
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
0 deletions
+129
-0
menu.c
dlls/user32/tests/menu.c
+129
-0
No files found.
dlls/user32/tests/menu.c
View file @
7744c700
...
...
@@ -2510,6 +2510,11 @@ if (0)
if
(
mii
.
hSubMenu
)
{
ok
(
mii
.
wID
==
(
UINT_PTR
)
mii
.
hSubMenu
,
"id %u: wID should be equal to hSubMenu
\n
"
,
checked_cmd
);
if
(
!
GetMenuItemCount
(
mii
.
hSubMenu
))
{
ok
(
mii
.
fType
==
checked_type
,
"id %u: expected fType %04x, got %04x
\n
"
,
checked_cmd
,
checked_type
,
mii
.
fType
);
ok
(
mii
.
fState
==
checked_state
,
"id %u: expected fState %04x, got %04x
\n
"
,
checked_cmd
,
checked_state
,
mii
.
fState
);
}
check_menu_items
(
mii
.
hSubMenu
,
checked_cmd
,
checked_type
,
checked_state
);
}
else
...
...
@@ -3618,6 +3623,129 @@ static void test_emptypopup(void)
ok
(
ret
,
"DestroyMenu failed with error %d
\n
"
,
GetLastError
());
}
static
void
test_AppendMenu
(
void
)
{
MENUITEMINFOA
mii
;
HMENU
hmenu
,
hsubmenu
;
BOOL
ret
;
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_OWNERDRAW
,
201
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
201
,
MF_OWNERDRAW
,
0
);
DestroyMenu
(
hmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_POPUP
,
202
,
"item 1"
);
todo_wine
ok
(
ret
,
"AppendMenu failed
\n
"
);
if
(
ret
)
/* FIXME: uncomment once Wine is fixed */
check_menu_items
(
hmenu
,
202
,
MF_STRING
,
0
);
DestroyMenu
(
hmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_OWNERDRAW
|
MF_POPUP
,
203
,
"item 1"
);
todo_wine
ok
(
ret
,
"AppendMenu failed
\n
"
);
if
(
ret
)
/* FIXME: uncomment once Wine is fixed */
check_menu_items
(
hmenu
,
203
,
MF_OWNERDRAW
,
0
);
DestroyMenu
(
hmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
hsubmenu
=
CreateMenu
();
ok
(
hsubmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_OWNERDRAW
,
(
UINT_PTR
)
hsubmenu
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
(
UINT_PTR
)
hsubmenu
,
MF_OWNERDRAW
,
0
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hsubmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
hsubmenu
=
CreateMenu
();
ok
(
hsubmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_POPUP
,
(
UINT_PTR
)
hsubmenu
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
(
UINT_PTR
)
hsubmenu
,
MF_STRING
,
0
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hsubmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
hsubmenu
=
CreateMenu
();
ok
(
hsubmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_OWNERDRAW
|
MF_POPUP
,
(
UINT_PTR
)
hsubmenu
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
(
UINT_PTR
)
hsubmenu
,
MF_OWNERDRAW
,
0
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hsubmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
hsubmenu
=
CreatePopupMenu
();
ok
(
hsubmenu
!=
0
,
"CreatePopupMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_OWNERDRAW
,
(
UINT_PTR
)
hsubmenu
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
(
UINT_PTR
)
hsubmenu
,
MF_OWNERDRAW
,
0
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hsubmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
hsubmenu
=
CreatePopupMenu
();
ok
(
hsubmenu
!=
0
,
"CreatePopupMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_POPUP
,
(
UINT_PTR
)
hsubmenu
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
(
UINT_PTR
)
hsubmenu
,
MF_STRING
,
0
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hsubmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
hsubmenu
=
CreatePopupMenu
();
ok
(
hsubmenu
!=
0
,
"CreatePopupMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_OWNERDRAW
|
MF_POPUP
,
(
UINT_PTR
)
hsubmenu
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
(
UINT_PTR
)
hsubmenu
,
MF_OWNERDRAW
,
0
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hsubmenu
);
hmenu
=
CreateMenu
();
ok
(
hmenu
!=
0
,
"CreateMenu failed
\n
"
);
ret
=
AppendMenuA
(
hmenu
,
MF_STRING
,
204
,
"item 1"
);
ok
(
ret
,
"AppendMenu failed
\n
"
);
check_menu_items
(
hmenu
,
204
,
MF_STRING
,
0
);
ret
=
ModifyMenuA
(
hmenu
,
0
,
MF_POPUP
|
MF_BYPOSITION
,
205
,
"item 2"
);
todo_wine
ok
(
ret
,
"ModifyMenu failed
\n
"
);
if
(
ret
)
/* FIXME: uncomment once Wine is fixed */
check_menu_items
(
hmenu
,
205
,
MF_STRING
,
0
);
memset
(
&
mii
,
0
,
sizeof
(
mii
));
mii
.
cbSize
=
sizeof
(
mii
);
mii
.
fMask
=
MIIM_SUBMENU
;
mii
.
hSubMenu
=
(
HMENU
)
204
;
ret
=
InsertMenuItemA
(
hmenu
,
0
,
TRUE
,
&
mii
);
ok
(
!
ret
,
"InsertMenuItem should fail
\n
"
);
ret
=
SetMenuItemInfoA
(
hmenu
,
0
,
TRUE
,
&
mii
);
ok
(
!
ret
,
"SetMenuItemInfo should fail
\n
"
);
mii
.
fMask
=
MIIM_ID
;
mii
.
wID
=
206
;
ret
=
InsertMenuItemA
(
hmenu
,
0
,
TRUE
,
&
mii
);
ok
(
ret
,
"InsertMenuItem failed
\n
"
);
if
(
0
)
/* FIXME: uncomment once Wine is fixed */
check_menu_items
(
hmenu
,
206
,
MF_SEPARATOR
,
MFS_GRAYED
);
mii
.
wID
=
207
;
ret
=
SetMenuItemInfoA
(
hmenu
,
0
,
TRUE
,
&
mii
);
ok
(
ret
,
"SetMenuItemInfo failed
\n
"
);
if
(
0
)
/* FIXME: uncomment once Wine is fixed */
check_menu_items
(
hmenu
,
207
,
MF_SEPARATOR
,
MFS_GRAYED
);
DestroyMenu
(
hmenu
);
}
START_TEST
(
menu
)
{
init_function_pointers
();
...
...
@@ -3655,4 +3783,5 @@ START_TEST(menu)
test_menu_maxdepth
();
test_menu_circref
();
test_emptypopup
();
test_AppendMenu
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment