diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 054feee221f..9670a7396fa 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -628,7 +628,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL; LPDIRECTSOUND3DLISTENER listener=NULL; DSBUFFERDESC bufdesc; - WAVEFORMATEX wfx; + WAVEFORMATEX wfx, wfx1; int ref; /* Create the DirectSound object */ @@ -659,6 +659,12 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, DXGetErrorString8(rc)); if (rc==DS_OK && primary!=NULL) { + rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL); + ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n", + DXGetErrorString8(rc)); + if (rc!=DS_OK) + goto EXIT1; + if (has_listener) { rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSound3DListener, @@ -710,7 +716,8 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000; bufdesc.lpwfxFormat=&wfx; if (winetest_interactive) { - trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n", + trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d " + "with a primary buffer at %ldx%dx%d\n", has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"", listener!=NULL||move_sound?"with ":"", @@ -718,7 +725,8 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, listener!=NULL?"listener ":"", listener&&move_sound?"and moving sound ":move_sound? "moving sound ":"", - wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels); + wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels, + wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels); } rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary!=NULL,"IDirectSound_CreateSoundBuffer() " @@ -839,6 +847,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, } } } +EXIT1: if (has_listener) { ref=IDirectSound3DListener_Release(listener); ok(ref==0,"IDirectSound3dListener_Release() listener has %d " diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c index d4891ec3c76..b1df2700cf3 100644 --- a/dlls/dsound/tests/ds3d8.c +++ b/dlls/dsound/tests/ds3d8.c @@ -530,7 +530,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play, LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL; LPDIRECTSOUND3DLISTENER listener=NULL; DSBUFFERDESC bufdesc; - WAVEFORMATEX wfx; + WAVEFORMATEX wfx, wfx1; int ref; /* Create the DirectSound object */ @@ -561,6 +561,12 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play, DXGetErrorString8(rc)); if (rc==DS_OK && primary!=NULL) { + rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL); + ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n", + DXGetErrorString8(rc)); + if (rc!=DS_OK) + goto EXIT1; + if (has_listener) { rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSound3DListener, @@ -624,7 +630,8 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play, } if (winetest_interactive) { - trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n", + trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d " + "with a primary buffer at %ldx%dx%d\n", has_3dbuffer?"3D ":"", has_duplicate?"duplicated ":"", listener!=NULL||move_sound?"with ":"", @@ -632,7 +639,8 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play, listener!=NULL?"listener ":"", listener&&move_sound?"and moving sound ":move_sound? "moving sound ":"", - wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels); + wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels, + wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels); } rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); ok(rc==DS_OK && secondary!=NULL,"IDirectSound8_CreateSoundBuffer() " @@ -753,6 +761,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play, } } } +EXIT1: if (has_listener) { ref=IDirectSound3DListener_Release(listener); ok(ref==0,"IDirectSound3dListener_Release() listener has %d " diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index af31dca8672..eeb6f0d6025 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -623,7 +623,7 @@ static HRESULT test_secondary(LPGUID lpGuid) LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL; DSBUFFERDESC bufdesc; DSCAPS dscaps; - WAVEFORMATEX wfx; + WAVEFORMATEX wfx, wfx1; DWORD f; int ref; @@ -659,6 +659,12 @@ static HRESULT test_secondary(LPGUID lpGuid) "%s\n",DXGetErrorString8(rc)); if (rc==DS_OK && primary!=NULL) { + rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL); + ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n", + DXGetErrorString8(rc)); + if (rc!=DS_OK) + goto EXIT1; + for (f=0;f