mmdevapi: Add tests for checking events to capture.

This commit is contained in:
Maarten Lankhorst 2012-02-29 23:43:56 +01:00 committed by Alexandre Julliard
parent 78f82fa063
commit 27adecec49

View file

@ -82,7 +82,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx)
HRESULT hr; HRESULT hr;
UINT32 frames, next, pad, sum = 0; UINT32 frames, next, pad, sum = 0;
BYTE *data; BYTE *data;
DWORD flags; DWORD flags, r;
UINT64 pos, qpc; UINT64 pos, qpc;
REFERENCE_TIME period; 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 /* Some w7 machines signal DATA_DISCONTINUITY here following the
* previous AUDCLNT_S_BUFFER_EMPTY, others not. What logic? */ * previous AUDCLNT_S_BUFFER_EMPTY, others not. What logic? */
ok(pos >= sum, "Position %u gap %d\n", (UINT)pos, (UINT)pos - sum); 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); IUnknown_Release(acc);
} }