Module: wine Branch: master Commit: 65d3682c22793c197ced98a54a04d0590ddcc828 URL: http://source.winehq.org/git/wine.git/?a=commit;h=65d3682c22793c197ced98a54a...
Author: Paul Vriens paul.vriens.wine@gmail.com Date: Mon Nov 12 16:56:49 2007 +0100
dsound/tests: Fix test failures on WinXP.
---
dlls/dsound/tests/ds3d8.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c index 359eafd..b072068 100644 --- a/dlls/dsound/tests/ds3d8.c +++ b/dlls/dsound/tests/ds3d8.c @@ -211,18 +211,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, dsbcaps.dwBufferBytes); }
- /* Query the format size. Note that it may not match sizeof(wfx) */ + /* Query the format size. */ size=0; rc=IDirectSoundBuffer_GetFormat(*dsbo,NULL,0,&size); ok(rc==DS_OK && size!=0,"IDirectSoundBuffer_GetFormat() should have " "returned the needed size: rc=%s size=%d\n",DXGetErrorString8(rc),size);
- rc=IDirectSoundBuffer_GetFormat(*dsbo,&wfx,sizeof(wfx),NULL); - if (wfx.wFormatTag == WAVE_FORMAT_EXTENSIBLE) - { + ok(size == sizeof(WAVEFORMATEX) || size == sizeof(WAVEFORMATEXTENSIBLE), + "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; - ok(rc == DSERR_INVALIDPARAM, "IDirectSoundBuffer_GetFormat returned: %s\n", DXGetErrorString8(rc)); - rc=IDirectSoundBuffer_GetFormat(*dsbo,(WAVEFORMATEX*)&wfxe,sizeof(wfxe),NULL); + rc=IDirectSoundBuffer_GetFormat(*dsbo,(WAVEFORMATEX*)&wfxe,size,NULL); wfx = wfxe.Format; } ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n",