Commit fc0b157c authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dsound/tests: Use the available ARRAY_SIZE() macro.

parent b509b548
...@@ -139,7 +139,7 @@ const char * getDSBCAPS(DWORD xmask) { ...@@ -139,7 +139,7 @@ const char * getDSBCAPS(DWORD xmask) {
buffer[0] = 0; buffer[0] = 0;
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++) { for (i = 0; i < ARRAY_SIZE(flags); i++) {
if ((flags[i].mask & xmask) == flags[i].mask) { if ((flags[i].mask & xmask) == flags[i].mask) {
if (first) if (first)
first = FALSE; first = FALSE;
......
...@@ -1004,8 +1004,8 @@ static HRESULT test_frequency(LPGUID lpGuid) ...@@ -1004,8 +1004,8 @@ static HRESULT test_frequency(LPGUID lpGuid)
if (rc!=DS_OK) if (rc!=DS_OK)
goto EXIT1; goto EXIT1;
for (f=0;f<sizeof(fmts)/sizeof(fmts[0]);f++) { for (f = 0; f < ARRAY_SIZE(fmts); f++) {
for (r=0;r<sizeof(rates)/sizeof(rates[0]);r++) { for (r = 0; r < ARRAY_SIZE(rates); r++) {
init_format(&wfx,WAVE_FORMAT_PCM,11025,fmts[f].bits, init_format(&wfx,WAVE_FORMAT_PCM,11025,fmts[f].bits,
fmts[f].channels); fmts[f].channels);
secondary=NULL; secondary=NULL;
...@@ -1135,7 +1135,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) ...@@ -1135,7 +1135,7 @@ static HRESULT test_duplicate(LPGUID lpGuid)
int i; int i;
/* Prepare notify events */ /* Prepare notify events */
for (i=0;i<sizeof(event)/sizeof(event[0]);i++) { for (i = 0; i < ARRAY_SIZE(event); i++) {
event[i] = CreateEventW(NULL, FALSE, FALSE, NULL); event[i] = CreateEventW(NULL, FALSE, FALSE, NULL);
} }
...@@ -1174,8 +1174,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) ...@@ -1174,8 +1174,7 @@ static HRESULT test_duplicate(LPGUID lpGuid)
"IDirectSound_DuplicateSoundBuffer failed %08x\n",rc); "IDirectSound_DuplicateSoundBuffer failed %08x\n",rc);
trace("testing duplicated buffer without notifications.\n"); trace("testing duplicated buffer without notifications.\n");
test_notify(duplicated,sizeof(event)/sizeof(event[0]), test_notify(duplicated, ARRAY_SIZE(event), event, WAIT_TIMEOUT);
event,WAIT_TIMEOUT);
rc=IDirectSoundBuffer_QueryInterface(duplicated, rc=IDirectSoundBuffer_QueryInterface(duplicated,
&IID_IDirectSoundNotify, &IID_IDirectSoundNotify,
...@@ -1192,8 +1191,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) ...@@ -1192,8 +1191,7 @@ static HRESULT test_duplicate(LPGUID lpGuid)
"failed %08x\n",rc); "failed %08x\n",rc);
trace("testing duplicated buffer with a notification.\n"); trace("testing duplicated buffer with a notification.\n");
test_notify(duplicated,sizeof(event)/sizeof(event[0]), test_notify(duplicated, ARRAY_SIZE(event), event, WAIT_OBJECT_0 + 1);
event,WAIT_OBJECT_0+1);
ref=IDirectSoundNotify_Release(dup_notify); ref=IDirectSoundNotify_Release(dup_notify);
ok(ref==0,"IDirectSoundNotify_Release() has %d references, " ok(ref==0,"IDirectSoundNotify_Release() has %d references, "
...@@ -1204,8 +1202,7 @@ static HRESULT test_duplicate(LPGUID lpGuid) ...@@ -1204,8 +1202,7 @@ static HRESULT test_duplicate(LPGUID lpGuid)
"should have 0\n",ref); "should have 0\n",ref);
trace("testing original buffer with a notification.\n"); trace("testing original buffer with a notification.\n");
test_notify(original,sizeof(event)/sizeof(event[0]), test_notify(original, ARRAY_SIZE(event), event, WAIT_OBJECT_0);
event,WAIT_OBJECT_0);
ref=IDirectSoundBuffer_Release(duplicated); ref=IDirectSoundBuffer_Release(duplicated);
ok(ref==0,"IDirectSoundBuffer_Release() has %d references, " ok(ref==0,"IDirectSoundBuffer_Release() has %d references, "
......
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