From: Francois Gouget fgouget@codeweavers.com
tryok() can be used to work around scheduling delays.
--- Note that the wine-specific aspect of flaky_wine is all moved to the wrapping LOOP_ON_FLAKY_WINE_TESTS() loop. There is no flaky_windows anyway so in case of a mix of flaky and flaky_wine one would simply use LOOP_ON_FLAKY_TESTS(). --- dlls/mmdevapi/tests/capture.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-)
diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c index f3b426a7f9a..7949523db3d 100644 --- a/dlls/mmdevapi/tests/capture.c +++ b/dlls/mmdevapi/tests/capture.c @@ -184,12 +184,10 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) * whereas GetCurrentPadding grows when input is not consumed. */ hr = IAudioCaptureClient_GetNextPacketSize(acc, &next); ok(hr == S_OK, "IAudioCaptureClient_GetNextPacketSize returns %08lx\n", hr); - flaky_wine - ok(next < pad, "GetNextPacketSize %u vs. GCP %u\n", next, pad); + tryok(next < pad, "GetNextPacketSize %u vs. GCP %u\n", next, pad);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc); - flaky_wine - ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); + tryok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); ok(next == frames, "GetNextPacketSize %u vs. GetBuffer %u\n", next, frames);
if(hr == S_OK){ @@ -258,8 +256,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) }
frames = period; - flaky_wine - ok(next == frames, "GetNextPacketSize %u vs. GetDevicePeriod %u\n", next, frames); + tryok(next == frames, "GetNextPacketSize %u vs. GetDevicePeriod %u\n", next, frames);
/* GetBufferSize is not a multiple of the period size! */ hr = IAudioClient_GetBufferSize(ac, &next); @@ -272,8 +269,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc); - flaky_wine - ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); + tryok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
trace("Overrun position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames); @@ -300,17 +296,14 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc); - flaky_wine - ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); + tryok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
trace("Cont'ed position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames);
if(hr == S_OK){ - flaky_wine - ok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum); - flaky_wine - ok(!flags, "flags %lu\n", flags); + tryok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum); + tryok(!flags, "flags %lu\n", flags);
hr = IAudioCaptureClient_ReleaseBuffer(acc, frames); ok(hr == S_OK, "Releasing buffer returns %08lx\n", hr); @@ -324,20 +317,17 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) ok(hr == S_OK, "Start on a stopped stream returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc); - flaky_wine - ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); + tryok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr);
hr = IAudioClient_GetCurrentPadding(ac, &pad); ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
trace("Restart position %d pad %u flags %lx, amount of frames locked: %u\n", hr==S_OK ? (UINT)pos : -1, pad, flags, frames); - flaky_wine - ok(pad > sum, "restarted GCP %u\n", pad); /* GCP is still near buffer size */ + tryok(pad > sum, "restarted GCP %u\n", pad); /* GCP is still near buffer size */
if(frames){ - flaky_wine - ok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum); + tryok(pos == sum, "Position %u expected %u\n", (UINT)pos, sum); ok(!flags, "flags %lu\n", flags);
hr = IAudioCaptureClient_ReleaseBuffer(acc, frames); @@ -376,8 +366,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) ok(hr == S_OK, "GetCurrentPadding call returns %08lx\n", hr);
hr = IAudioCaptureClient_GetBuffer(acc, &data, &frames, &flags, &pos, &qpc); - flaky_wine - ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); + tryok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08lx\n", hr); trace("Running position %d pad %u flags %lx, amount of frames locked: %u\n", SUCCEEDED(hr) ? (UINT)pos : -1, pad, flags, frames);
@@ -550,7 +539,7 @@ static void test_audioclient(void) hr = IAudioClient_Stop(ac); ok(hr == S_FALSE, "Stop on a stopped stream returns %08lx\n", hr);
- test_capture(ac, handle, pwfx); + LOOP_ON_FLAKY_WINE_TESTS(3) test_capture(ac, handle, pwfx);
cleanup: IAudioClient_Release(ac);