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
bda21aa9
Commit
bda21aa9
authored
Sep 30, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Add more timer tests.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
daec24a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
timer.c
dlls/winmm/tests/timer.c
+55
-0
No files found.
dlls/winmm/tests/timer.c
View file @
bda21aa9
...
...
@@ -193,6 +193,60 @@ static void test_priority(void)
timeKillEvent
(
id
);
}
static
void
CALLBACK
kill_timer_callback
(
UINT
id
,
UINT
msg
,
DWORD_PTR
arg
,
DWORD_PTR
dw1
,
DWORD_PTR
dw2
)
{
HANDLE
event
=
(
HANDLE
)
arg
;
MMRESULT
res
;
res
=
timeKillEvent
(
id
);
ok
(
res
==
TIMERR_NOERROR
,
"timeKillEvent failed in callback
\n
"
);
SetEvent
(
event
);
}
static
void
test_timer_lifetime
(
void
)
{
UINT
timers
[
20
],
i
;
HANDLE
event
;
MMRESULT
res
;
event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
event
!=
NULL
,
"CreateEvent failed
\n
"
);
for
(
i
=
0
;
i
<
20
;
i
++
)
{
timers
[
i
]
=
timeSetEvent
(
10000
,
0
,
event
,
0
,
TIME_CALLBACK_EVENT_SET
);
if
(
i
<
16
)
ok
(
timers
[
i
]
!=
0
,
"%d) timeSetEvent failed
\n
"
,
i
);
else
ok
(
!
timers
[
i
],
"%d) timeSetEvent succeeded
\n
"
,
i
);
}
for
(
i
=
0
;
i
<
16
;
i
++
)
{
res
=
timeKillEvent
(
timers
[
i
]);
ok
(
res
==
TIMERR_NOERROR
,
"%d) timeKillEvent failed
\n
"
,
i
);
}
timers
[
0
]
=
timeSetEvent
(
10
,
0
,
event
,
0
,
TIME_CALLBACK_EVENT_SET
);
ok
(
timers
[
0
],
"timeSetEvent failed
\n
"
);
WaitForSingleObject
(
event
,
1000
);
timers
[
1
]
=
timeSetEvent
(
1000
,
0
,
event
,
0
,
TIME_CALLBACK_EVENT_SET
);
ok
(
timers
[
1
],
"timeSetEvent failed
\n
"
);
ok
(
timers
[
0
]
!=
timers
[
1
],
"timer got the same id as just destroyed timer
\n
"
);
res
=
timeKillEvent
(
timers
[
0
]);
ok
(
res
==
TIMERR_NOCANDO
,
"timeKillEvent returned %d
\n
"
,
res
);
res
=
timeKillEvent
(
timers
[
1
]);
ok
(
res
==
TIMERR_NOERROR
,
"timeKillEvent returned %d
\n
"
,
res
);
timers
[
0
]
=
timeSetEvent
(
10
,
0
,
kill_timer_callback
,
(
DWORD_PTR
)
event
,
TIME_ONESHOT
);
WaitForSingleObject
(
event
,
1000
);
timers
[
0
]
=
timeSetEvent
(
10
,
0
,
kill_timer_callback
,
(
DWORD_PTR
)
event
,
TIME_KILL_SYNCHRONOUS
);
WaitForSingleObject
(
event
,
1000
);
CloseHandle
(
event
);
}
START_TEST
(
timer
)
{
test_timeGetDevCaps
();
...
...
@@ -216,4 +270,5 @@ START_TEST(timer)
}
test_priority
();
test_timer_lifetime
();
}
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