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
946cd3c1
Commit
946cd3c1
authored
Mar 19, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case which confirms that SetMenu implementation in Wine is
correct.
parent
052144fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
win.c
dlls/user/tests/win.c
+48
-0
No files found.
dlls/user/tests/win.c
View file @
946cd3c1
...
...
@@ -1175,6 +1175,53 @@ static void test_SetWindowPos(HWND hwnd)
SetWindowPos
(
hwnd
,
0
,
32768
,
40000
,
32768
,
40000
,
SWP_NOSIZE
);
}
static
void
test_SetMenu
(
HWND
parent
)
{
HWND
child
;
HMENU
hMenu
,
ret
;
hMenu
=
CreateMenu
();
assert
(
hMenu
);
/* parent */
ret
=
GetMenu
(
parent
);
ok
(
ret
==
0
,
"unexpected menu id %p
\n
"
,
ret
);
ok
(
!
SetMenu
(
parent
,
(
HMENU
)
20
),
"SetMenu with invalid menu handle should fail
\n
"
);
ret
=
GetMenu
(
parent
);
ok
(
ret
==
0
,
"unexpected menu id %p
\n
"
,
ret
);
ok
(
SetMenu
(
parent
,
hMenu
),
"SetMenu on a top level window should not fail
\n
"
);
ret
=
GetMenu
(
parent
);
ok
(
ret
==
(
HMENU
)
hMenu
,
"unexpected menu id %p
\n
"
,
ret
);
ok
(
SetMenu
(
parent
,
0
),
"SetMenu(0) on a top level window should not fail
\n
"
);
ret
=
GetMenu
(
parent
);
ok
(
ret
==
0
,
"unexpected menu id %p
\n
"
,
ret
);
/* child */
child
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
,
0
,
0
,
0
,
0
,
parent
,
(
HMENU
)
10
,
0
,
NULL
);
assert
(
child
);
ret
=
GetMenu
(
child
);
ok
(
ret
==
(
HMENU
)
10
,
"unexpected menu id %p
\n
"
,
ret
);
ok
(
!
SetMenu
(
child
,
(
HMENU
)
20
),
"SetMenu with invalid menu handle should fail
\n
"
);
ret
=
GetMenu
(
child
);
ok
(
ret
==
(
HMENU
)
10
,
"unexpected menu id %p
\n
"
,
ret
);
ok
(
!
SetMenu
(
child
,
hMenu
),
"SetMenu on a child window should fail
\n
"
);
ret
=
GetMenu
(
child
);
ok
(
ret
==
(
HMENU
)
10
,
"unexpected menu id %p
\n
"
,
ret
);
ok
(
!
SetMenu
(
child
,
0
),
"SetMenu(0) on a child window should fail
\n
"
);
ret
=
GetMenu
(
child
);
ok
(
ret
==
(
HMENU
)
10
,
"unexpected menu id %p
\n
"
,
ret
);
DestroyWindow
(
child
);
DestroyMenu
(
hMenu
);
}
START_TEST
(
win
)
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
...
...
@@ -1203,6 +1250,7 @@ START_TEST(win)
test_mdi
();
test_icons
();
test_SetWindowPos
(
hwndMain
);
test_SetMenu
(
hwndMain
);
UnhookWindowsHookEx
(
hhook
);
}
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