dsound/tests: Fix test failures on WinXP.

This commit is contained in:
Paul Vriens 2007-11-12 16:56:49 +01:00 committed by Alexandre Julliard
parent 894a705cc7
commit 65d3682c22
1 changed files with 8 additions and 6 deletions

View File

@ -211,18 +211,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
dsbcaps.dwBufferBytes); dsbcaps.dwBufferBytes);
} }
/* Query the format size. Note that it may not match sizeof(wfx) */ /* Query the format size. */
size=0; size=0;
rc=IDirectSoundBuffer_GetFormat(*dsbo,NULL,0,&size); rc=IDirectSoundBuffer_GetFormat(*dsbo,NULL,0,&size);
ok(rc==DS_OK && size!=0,"IDirectSoundBuffer_GetFormat() should have " ok(rc==DS_OK && size!=0,"IDirectSoundBuffer_GetFormat() should have "
"returned the needed size: rc=%s size=%d\n",DXGetErrorString8(rc),size); "returned the needed size: rc=%s size=%d\n",DXGetErrorString8(rc),size);
rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,sizeof(wfx),NULL); ok(size == sizeof(WAVEFORMATEX) || size == sizeof(WAVEFORMATEXTENSIBLE),
if (wfx.wFormatTag == WAVE_FORMAT_EXTENSIBLE) "Expected a correct structure size, got %d\n", size);
{
if (size == sizeof(WAVEFORMATEX)) {
rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,size,NULL);
} else if (size == sizeof(WAVEFORMATEXTENSIBLE)) {
WAVEFORMATEXTENSIBLE wfxe; WAVEFORMATEXTENSIBLE wfxe;
ok(rc == DSERR_INVALIDPARAM, "IDirectSoundBuffer_GetFormat returned: %s\n", DXGetErrorString8(rc)); rc=IDirectSoundBuffer_GetFormat(*dsbo,(WAVEFORMATEX*)&wfxe,size,NULL);
rc=IDirectSoundBuffer_GetFormat(*dsbo,(WAVEFORMATEX*)&wfxe,sizeof(wfxe),NULL);
wfx = wfxe.Format; wfx = wfxe.Format;
} }
ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n", ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n",