Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
d366ef51
Commit
d366ef51
authored
May 01, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u/tests: Add NtUserThunkedMenuItemInfo tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77ab5101
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
win32u.c
dlls/win32u/tests/win32u.c
+75
-0
No files found.
dlls/win32u/tests/win32u.c
View file @
d366ef51
...
...
@@ -505,6 +505,80 @@ static void test_window_text(void)
DestroyWindow
(
hwnd
);
}
#define test_menu_item_id(a, b, c) test_menu_item_id_(a, b, c, __LINE__)
static
void
test_menu_item_id_
(
HMENU
menu
,
int
pos
,
int
expect
,
int
line
)
{
MENUITEMINFOW
item
;
BOOL
ret
;
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_ID
;
ret
=
GetMenuItemInfoW
(
menu
,
pos
,
TRUE
,
&
item
);
ok_
(
__FILE__
,
line
)(
ret
,
"GetMenuItemInfoW failed: %lu
\n
"
,
GetLastError
()
);
ok_
(
__FILE__
,
line
)(
item
.
wID
==
expect
,
"got if %d, expected %d
\n
"
,
item
.
wID
,
expect
);
}
static
void
test_menu
(
void
)
{
MENUITEMINFOW
item
;
HMENU
menu
;
int
count
;
BOOL
ret
;
menu
=
CreateMenu
();
memset
(
&
item
,
0
,
sizeof
(
item
)
);
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_ID
;
item
.
wID
=
10
;
ret
=
NtUserThunkedMenuItemInfo
(
menu
,
0
,
MF_BYPOSITION
,
NtUserInsertMenuItem
,
&
item
,
NULL
);
ok
(
ret
,
"InsertMenuItemW failed: %lu
\n
"
,
GetLastError
()
);
count
=
GetMenuItemCount
(
menu
);
ok
(
count
==
1
,
"count = %d
\n
"
,
count
);
item
.
wID
=
20
;
ret
=
NtUserThunkedMenuItemInfo
(
menu
,
1
,
MF_BYPOSITION
,
NtUserInsertMenuItem
,
&
item
,
NULL
);
ok
(
ret
,
"InsertMenuItemW failed: %lu
\n
"
,
GetLastError
()
);
count
=
GetMenuItemCount
(
menu
);
ok
(
count
==
2
,
"count = %d
\n
"
,
count
);
test_menu_item_id
(
menu
,
0
,
10
);
test_menu_item_id
(
menu
,
1
,
20
);
item
.
wID
=
30
;
ret
=
NtUserThunkedMenuItemInfo
(
menu
,
1
,
MF_BYPOSITION
,
NtUserInsertMenuItem
,
&
item
,
NULL
);
ok
(
ret
,
"InsertMenuItemW failed: %lu
\n
"
,
GetLastError
()
);
count
=
GetMenuItemCount
(
menu
);
ok
(
count
==
3
,
"count = %d
\n
"
,
count
);
test_menu_item_id
(
menu
,
0
,
10
);
test_menu_item_id
(
menu
,
1
,
30
);
test_menu_item_id
(
menu
,
2
,
20
);
item
.
wID
=
50
;
ret
=
NtUserThunkedMenuItemInfo
(
menu
,
10
,
0
,
NtUserInsertMenuItem
,
&
item
,
NULL
);
ok
(
ret
,
"InsertMenuItemW failed: %lu
\n
"
,
GetLastError
()
);
count
=
GetMenuItemCount
(
menu
);
ok
(
count
==
4
,
"count = %d
\n
"
,
count
);
test_menu_item_id
(
menu
,
0
,
50
);
test_menu_item_id
(
menu
,
1
,
10
);
test_menu_item_id
(
menu
,
2
,
30
);
test_menu_item_id
(
menu
,
3
,
20
);
item
.
wID
=
60
;
ret
=
NtUserThunkedMenuItemInfo
(
menu
,
1
,
MF_BYPOSITION
,
NtUserSetMenuItemInfo
,
&
item
,
NULL
);
ok
(
ret
,
"InsertMenuItemW failed: %lu
\n
"
,
GetLastError
()
);
count
=
GetMenuItemCount
(
menu
);
ok
(
count
==
4
,
"count = %d
\n
"
,
count
);
test_menu_item_id
(
menu
,
1
,
60
);
ret
=
NtUserDestroyMenu
(
menu
);
ok
(
ret
,
"NtUserDestroyMenu failed: %lu
\n
"
,
GetLastError
()
);
}
START_TEST
(
win32u
)
{
/* native win32u.dll fails if user32 is not loaded, so make sure it's fully initialized */
...
...
@@ -517,6 +591,7 @@ START_TEST(win32u)
test_cursoricon
();
test_message_call
();
test_window_text
();
test_menu
();
test_NtUserCloseWindowStation
();
}
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