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
d2ec02e0
Commit
d2ec02e0
authored
Mar 18, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some tests for ShowCursor.
parent
93b3ba76
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
cursoricon.c
dlls/user32/tests/cursoricon.c
+95
-0
No files found.
dlls/user32/tests/cursoricon.c
View file @
d2ec02e0
...
...
@@ -1436,6 +1436,100 @@ static void test_SetCursor(void)
"wrong error %u
\n
"
,
error
);
}
static
HANDLE
event_start
,
event_next
;
static
DWORD
CALLBACK
show_cursor_thread
(
void
*
arg
)
{
DWORD
count
=
(
DWORD_PTR
)
arg
;
int
ret
;
PeekMessage
(
0
,
0
,
0
,
0
,
PM_NOREMOVE
);
/* create a msg queue */
if
(
parent_id
)
{
BOOL
ret
=
AttachThreadInput
(
GetCurrentThreadId
(),
parent_id
,
TRUE
);
ok
(
ret
,
"AttachThreadInput failed
\n
"
);
}
if
(
!
count
)
ret
=
ShowCursor
(
FALSE
);
else
while
(
count
--
)
ret
=
ShowCursor
(
TRUE
);
SetEvent
(
event_start
);
WaitForSingleObject
(
event_next
,
2000
);
return
ret
;
}
static
void
test_ShowCursor
(
void
)
{
int
count
;
DWORD
id
,
result
;
HANDLE
thread
;
event_start
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
event_next
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
count
=
ShowCursor
(
TRUE
);
ok
(
count
==
1
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
TRUE
);
ok
(
count
==
2
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
1
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
0
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
-
1
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
-
2
,
"wrong count %d
\n
"
,
count
);
parent_id
=
0
;
thread
=
CreateThread
(
NULL
,
0
,
show_cursor_thread
,
NULL
,
0
,
&
id
);
WaitForSingleObject
(
event_start
,
1000
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
-
3
,
"wrong count %d
\n
"
,
count
);
SetEvent
(
event_next
);
WaitForSingleObject
(
thread
,
1000
);
GetExitCodeThread
(
thread
,
&
result
);
ok
(
result
==
-
1
,
"wrong thread count %d
\n
"
,
result
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
-
4
,
"wrong count %d
\n
"
,
count
);
thread
=
CreateThread
(
NULL
,
0
,
show_cursor_thread
,
(
void
*
)
1
,
0
,
&
id
);
WaitForSingleObject
(
event_start
,
1000
);
count
=
ShowCursor
(
TRUE
);
ok
(
count
==
-
3
,
"wrong count %d
\n
"
,
count
);
SetEvent
(
event_next
);
WaitForSingleObject
(
thread
,
1000
);
GetExitCodeThread
(
thread
,
&
result
);
ok
(
result
==
1
,
"wrong thread count %d
\n
"
,
result
);
count
=
ShowCursor
(
TRUE
);
ok
(
count
==
-
2
,
"wrong count %d
\n
"
,
count
);
parent_id
=
GetCurrentThreadId
();
thread
=
CreateThread
(
NULL
,
0
,
show_cursor_thread
,
NULL
,
0
,
&
id
);
WaitForSingleObject
(
event_start
,
1000
);
count
=
ShowCursor
(
TRUE
);
todo_wine
ok
(
count
==
-
2
,
"wrong count %d
\n
"
,
count
);
SetEvent
(
event_next
);
WaitForSingleObject
(
thread
,
1000
);
GetExitCodeThread
(
thread
,
&
result
);
todo_wine
ok
(
result
==
-
3
,
"wrong thread count %d
\n
"
,
result
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
-
2
,
"wrong count %d
\n
"
,
count
);
thread
=
CreateThread
(
NULL
,
0
,
show_cursor_thread
,
(
void
*
)
3
,
0
,
&
id
);
WaitForSingleObject
(
event_start
,
1000
);
count
=
ShowCursor
(
TRUE
);
todo_wine
ok
(
count
==
2
,
"wrong count %d
\n
"
,
count
);
SetEvent
(
event_next
);
WaitForSingleObject
(
thread
,
1000
);
GetExitCodeThread
(
thread
,
&
result
);
todo_wine
ok
(
result
==
1
,
"wrong thread count %d
\n
"
,
result
);
count
=
ShowCursor
(
FALSE
);
ok
(
count
==
-
2
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
TRUE
);
ok
(
count
==
-
1
,
"wrong count %d
\n
"
,
count
);
count
=
ShowCursor
(
TRUE
);
ok
(
count
==
0
,
"wrong count %d
\n
"
,
count
);
}
static
void
test_DestroyCursor
(
void
)
{
...
...
@@ -1548,6 +1642,7 @@ START_TEST(cursoricon)
test_DrawIconEx
();
test_DrawState
();
test_SetCursor
();
test_ShowCursor
();
test_DestroyCursor
();
do_parent
();
test_child_process
();
...
...
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