On Mon, Jan 11, 2021 at 08:41:22PM -0500, Shawn M. Chapla wrote:
diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index e326fe8d839..fb445794bd1 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -30,7 +30,8 @@
#include "dsound_test.h"
-#define NOTIFICATIONS 5 +#define TIMESTAMP_CAPTURE_NTFCTNS 5 +#define TOTAL_CAPTURE_NTFCTNS (TIMESTAMP_CAPTURE_NTFCTNS + 1)
I'd s/CAPTURE_NTFCTNS/NOTIFICATIONS/g, but I won't argue if you prefer this.
@@ -403,15 +407,15 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, "GetStatus: bad status: %x\n",status);
if (record) { - /* wait for the notifications */ - for (i = 0; i < (NOTIFICATIONS * 2); i++) { - rc=WaitForMultipleObjects(NOTIFICATIONS,state.event,FALSE,3000); - ok(rc==(WAIT_OBJECT_0+(i%NOTIFICATIONS)), + /* wait for timestamp notifications */ + for (i = 0; i < (TIMESTAMP_CAPTURE_NTFCTNS * 2); i++) { + rc = WaitForMultipleObjects(TOTAL_CAPTURE_NTFCTNS, state.event, FALSE, 3000); + ok(rc == (WAIT_OBJECT_0 + (i % TIMESTAMP_CAPTURE_NTFCTNS)), "WaitForMultipleObjects failed: 0x%x\n",rc); - if (rc!=(WAIT_OBJECT_0+(i%NOTIFICATIONS))) { + if (rc != (WAIT_OBJECT_0 + (i % TIMESTAMP_CAPTURE_NTFCTNS))) { ok((rc==WAIT_TIMEOUT)||(rc==WAIT_FAILED), "Wrong notification: should be %d, got %d\n", - i%NOTIFICATIONS,rc-WAIT_OBJECT_0); + i % TIMESTAMP_CAPTURE_NTFCTNS, rc - WAIT_OBJECT_0); } if (!capture_buffer_service(&state)) break;
I know the indent style sucks, but it is (mostly) consistent: it uses four-space indentation, with each group of eight spaces replaced with a tab. Please either match that style (my preference), or just convert this whole paragraph to use spaces.
@@ -421,6 +425,10 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, rc=IDirectSoundCaptureBuffer_Stop(dscbo); ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08x\n", rc);
+ /* wait for stop notification */ + rc = WaitForSingleObject(state.event[TIMESTAMP_CAPTURE_NTFCTNS], 3000); + todo_wine ok(rc == WAIT_OBJECT_0, "WaitForSingleObject failed: 0x%x\n", rc); + rc=IDirectSoundCaptureBuffer_Stop(dscbo); ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08x\n", rc); }
I think you should merge the two patches into one. It will avoid a very long delay due to this 3-second timeout for every test loop, and there isn't enough new code to need splitting. The long delay caused test timeouts in the testbot: https://testbot.winehq.org/JobDetails.pl?Key=83923#k401 Andrew