Commit 27adecec authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

mmdevapi: Add tests for checking events to capture.

parent 78f82fa0
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment