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
3c68ba1b
Commit
3c68ba1b
authored
Feb 11, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm/tests: Don't test upper bound on sound duration, it's not guaranteed.
Also avoid infinite waits.
parent
b03175e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
wave.c
dlls/winmm/tests/wave.c
+12
-14
No files found.
dlls/winmm/tests/wave.c
View file @
3c68ba1b
...
...
@@ -603,7 +603,7 @@ static void wave_out_test_deviceOut(int device, double duration,
DWORD
nSamplesPerSec
=
pwfx
->
nSamplesPerSec
;
BOOL
has_volume
=
pcaps
->
dwSupport
&
WAVECAPS_VOLUME
?
TRUE
:
FALSE
;
double
paused
=
0
.
0
;
double
actual
;
DWORD
actual
;
DWORD_PTR
callback
=
0
;
DWORD_PTR
callback_instance
=
0
;
HANDLE
thread
=
0
;
...
...
@@ -628,7 +628,7 @@ static void wave_out_test_deviceOut(int device, double duration,
thread
=
CreateThread
(
NULL
,
0
,
callback_thread
,
hevent
,
0
,
&
thread_id
);
if
(
thread
)
{
/* make sure thread is running */
WaitForSingleObject
(
hevent
,
INFINITE
);
WaitForSingleObject
(
hevent
,
10000
);
callback
=
thread_id
;
callback_instance
=
0
;
}
else
{
...
...
@@ -680,7 +680,7 @@ static void wave_out_test_deviceOut(int device, double duration,
if
(
rc
!=
MMSYSERR_NOERROR
)
goto
EXIT
;
WaitForSingleObject
(
hevent
,
INFINITE
);
WaitForSingleObject
(
hevent
,
10000
);
ok
(
pwfx
->
nChannels
==
nChannels
&&
pwfx
->
wBitsPerSample
==
wBitsPerSample
&&
...
...
@@ -785,19 +785,17 @@ static void wave_out_test_deviceOut(int device, double duration,
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutWrite(%s, header[%d]): rc=%s
\n
"
,
dev_name
(
device
),(
i
+
1
)
%
headers
,
wave_out_error
(
rc
));
}
WaitForSingleObject
(
hevent
,
INFINITE
);
WaitForSingleObject
(
hevent
,
10000
);
}
}
/* Check the sound duration was
between -10% and +35
% of the expected value */
/* Check the sound duration was
at least 90
% of the expected value */
end
=
GetTickCount
();
actual
=
(
end
-
start
)
/
1000
.
0
;
if
(
winetest_debug
>
1
)
trace
(
"sound duration=%g ms
\n
"
,
1000
*
actual
);
ok
((
actual
>
(
0
.
9
*
(
duration
+
paused
)))
&&
(
actual
<
(
1
.
35
*
(
duration
+
paused
))),
"The sound played for %g ms instead of %g ms
\n
"
,
1000
*
actual
,
1000
*
(
duration
+
paused
));
actual
=
end
-
start
;
trace
(
"sound duration=%u ms
\n
"
,
actual
);
ok
(
actual
>
900
*
(
duration
+
paused
),
"The sound played for %u ms instead of %g ms
\n
"
,
actual
,
1000
*
(
duration
+
paused
));
for
(
i
=
0
;
i
<
headers
;
i
++
)
{
ok
(
frags
[
i
].
dwFlags
=
(
WHDR_DONE
|
WHDR_PREPARED
),
"WHDR_DONE WHDR_PREPARED expected, got %s
\n
"
,
...
...
@@ -817,11 +815,11 @@ static void wave_out_test_deviceOut(int device, double duration,
rc
=
waveOutClose
(
wout
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutClose(%s): rc=%s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
WaitForSingleObject
(
hevent
,
INFINITE
);
WaitForSingleObject
(
hevent
,
10000
);
EXIT:
if
((
flags
&
CALLBACK_TYPEMASK
)
==
CALLBACK_THREAD
)
{
PostThreadMessage
(
thread_id
,
WM_APP
,
0
,
0
);
WaitForSingleObject
(
hevent
,
INFINITE
);
WaitForSingleObject
(
hevent
,
10000
);
}
CloseHandle
(
hevent
);
HeapFree
(
GetProcessHeap
(),
0
,
frags
);
...
...
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