Module: wine Branch: master Commit: 27adecec49c7a02f2e8cbdbed9d2012e97bb6532 URL: http://source.winehq.org/git/wine.git/?a=commit;h=27adecec49c7a02f2e8cbdbed9...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Wed Feb 29 23:43:56 2012 +0100
mmdevapi: Add tests for checking events to capture.
---
dlls/mmdevapi/tests/capture.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c index e13e813..96ddf77 100644 --- a/dlls/mmdevapi/tests/capture.c +++ b/dlls/mmdevapi/tests/capture.c @@ -82,7 +82,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) HRESULT hr; UINT32 frames, next, pad, sum = 0; BYTE *data; - DWORD flags; + DWORD flags, r; UINT64 pos, qpc; REFERENCE_TIME period;
@@ -413,8 +413,35 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) /* Some w7 machines signal DATA_DISCONTINUITY here following the * previous AUDCLNT_S_BUFFER_EMPTY, others not. What logic? */ ok(pos >= sum, "Position %u gap %d\n", (UINT)pos, (UINT)pos - sum); + IAudioCaptureClient_ReleaseBuffer(acc, frames); }
+ hr = IAudioClient_Stop(ac); + ok(hr == S_OK, "Stop failed: %08x\n", hr); + + ok(ResetEvent(handle), "ResetEvent\n"); + + /* Still receiving events! */ + r = WaitForSingleObject(handle, 20); + todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); + + hr = IAudioClient_Reset(ac); + ok(hr == S_OK, "Reset failed: %08x\n", hr); + + ok(ResetEvent(handle), "ResetEvent\n"); + + r = WaitForSingleObject(handle, 120); + todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); + + hr = IAudioClient_SetEventHandle(ac, NULL); + ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); + + r = WaitForSingleObject(handle, 70); + todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); + + hr = IAudioClient_Start(ac); + ok(hr == S_OK, "Start failed: %08x\n", hr); + IUnknown_Release(acc); }