From 4066d0249ca04a4c5c0665614499fa238f2663cd Mon Sep 17 00:00:00 2001 From: Jeff Zaroyko Date: Thu, 4 Dec 2008 19:15:12 +1100 Subject: dsound: fix remaining ds3d, dsound, dsound8 test failures shown on test.winehq.org --- dlls/dsound/tests/ds3d.c | 16 ++++++++++--- dlls/dsound/tests/dsound.c | 49 +++++++++++++++++++++++++++++-------------- dlls/dsound/tests/dsound8.c | 20 +++++++++++------ 3 files changed, 58 insertions(+), 27 deletions(-) diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index c3fa0ed..0da74e8 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -720,7 +720,9 @@ static HRESULT test_secondary(LPGUID lpGuid, int play, else bufdesc.dwFlags|=(DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN); rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL), + ok((rc==DS_OK && primary!=NULL) || + rc==DSERR_INVALIDPARAM || + rc==DSERR_CONTROLUNAVAIL, "IDirectSound_CreateSoundBuffer() failed to create a %sprimary buffer: %08x\n",has_3d?"3D ":"", rc); if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); @@ -998,7 +1000,9 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL), + ok((rc==DS_OK && primary!=NULL) || + rc==DSERR_INVALIDPARAM || + rc==DSERR_CONTROLUNAVAIL, "IDirectSound_CreateSoundBuffer() failed to create a primary buffer: %08x\n",rc); if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); @@ -1080,7 +1084,9 @@ static HRESULT test_primary_3d(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed " + ok((rc==DS_OK || + rc==DSERR_INVALIDPARAM) + && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed " "to create a primary buffer: %08x\n",rc); if (rc==DS_OK && primary!=NULL) { ref=IDirectSoundBuffer_Release(primary); @@ -1150,7 +1156,9 @@ static HRESULT test_primary_3d_with_listener(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRL3D; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed " + ok((rc==DS_OK || + rc==DSERR_INVALIDPARAM) + && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed " "to create a 3D primary buffer: %08x\n",rc); if (rc==DS_OK && primary!=NULL) { LPDIRECTSOUND3DLISTENER listener=NULL; diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 10a3fa8..2675713 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -319,7 +319,8 @@ static HRESULT test_dsound(LPGUID lpGuid) wfx.nBlockAlign); bufdesc.lpwfxFormat=&wfx; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(rc==DS_OK && secondary!=NULL, + ok((rc==DS_OK && secondary!=NULL) || + rc==DSERR_INVALIDPARAM, "IDirectSound_CreateSoundBuffer() failed to create a secondary " "buffer %08x\n",rc); if (rc==DS_OK && secondary!=NULL) { @@ -445,7 +446,9 @@ static HRESULT test_primary(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL), + ok((rc==DS_OK && primary!=NULL) || + rc==DSERR_INVALIDPARAM || + rc==DSERR_CONTROLUNAVAIL, "IDirectSound_CreateSoundBuffer() failed to create a primary buffer: %08x\n",rc); if (rc==DSERR_CONTROLUNAVAIL) trace(" No Primary\n"); @@ -544,7 +547,8 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok(rc==DS_OK && primary!=NULL, + ok((rc==DS_OK && primary!=NULL) || + rc==DSERR_INVALIDPARAM, "IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc); if (rc==DS_OK && primary!=NULL) { @@ -567,7 +571,9 @@ static HRESULT test_primary_secondary(LPGUID lpGuid) ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat(%s) failed: %08x\n", format_string(&wfx), rc); else - ok(rc==DS_OK || rc == E_INVALIDARG, "SetFormat (%s) failed: %08x\n", + ok(rc==DS_OK || + rc==DSERR_ALLOCATED || + rc==DSERR_INVALIDPARAM, "SetFormat (%s) returned: %08x\n", format_string(&wfx), rc); /* There is no guarantee that SetFormat will actually change the @@ -680,7 +686,8 @@ static HRESULT test_secondary(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok(rc==DS_OK && primary!=NULL, + ok((rc==DS_OK && primary!=NULL) || + rc==DSERR_INVALIDPARAM, "IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc); if (rc==DS_OK && primary!=NULL) { @@ -716,11 +723,12 @@ static HRESULT test_secondary(LPGUID lpGuid) if (gotdx8 || wfx.wBitsPerSample <= 16) { if (wfx.wBitsPerSample > 16) - ok(((rc == DSERR_CONTROLUNAVAIL || rc == DSERR_INVALIDCALL || rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary) + ok(((rc == DSERR_CONTROLUNAVAIL || + rc == DSERR_INVALIDCALL || + rc == DSERR_BADFORMAT || + rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary) || rc == DS_OK, /* driver dependent? */ - "IDirectSound_CreateSoundBuffer() " - "should have returned (DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL) " - "and NULL, returned: %08x %p\n", rc, secondary); + "IDirectSound_CreateSoundBuffer() returned %08x %p\n", rc, secondary); else ok(rc==DS_OK && secondary!=NULL, "IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc); @@ -763,7 +771,10 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.Format.cbSize = sizeof(wfxe) - sizeof(wfx) + 1; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL || rc==DSERR_INVALIDPARAM) + ok(((rc==DSERR_CONTROLUNAVAIL || + rc==DSERR_INVALIDCALL || + rc==DSERR_BADFORMAT || + rc==DSERR_INVALIDPARAM) && !secondary) || rc==DS_OK, /* 2003 / 2008 */ "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", @@ -777,7 +788,9 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.Format.cbSize = sizeof(wfxe) - sizeof(wfx); wfxe.SubFormat = GUID_NULL; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok((rc==DSERR_INVALIDPARAM || rc==DSERR_INVALIDCALL) && !secondary, + ok((rc==DSERR_INVALIDPARAM || + rc==DSERR_BADFORMAT || + rc==DSERR_INVALIDCALL) && !secondary, "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", rc, secondary); if (secondary) @@ -801,7 +814,8 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.Samples.wValidBitsPerSample = 0; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(rc==DS_OK && secondary, + ok((rc==DS_OK && secondary) || + rc==DSERR_BADFORMAT, "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", rc, secondary); if (secondary) @@ -812,7 +826,8 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.Samples.wValidBitsPerSample = wfxe.Format.wBitsPerSample; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(rc==DS_OK && secondary!=NULL, + ok((rc==DS_OK && secondary!=NULL) || + rc==DSERR_BADFORMAT, "IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %08x\n",rc); no_wfe: @@ -876,8 +891,9 @@ static HRESULT test_block_align(LPGUID lpGuid) bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec + 1; bufdesc.lpwfxFormat=&wfx; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(rc==DS_OK,"IDirectSound_CreateSoundBuffer() " - "should have returned DS_OK, returned: %08x\n", rc); + ok(rc==DS_OK || + rc==DSERR_INVALIDPARAM, + "IDirectSound_CreateSoundBuffer() returned: %08x\n", rc); if (rc==DS_OK && secondary!=NULL) { ZeroMemory(&dsbcaps, sizeof(dsbcaps)); @@ -959,7 +975,8 @@ static HRESULT test_frequency(LPGUID lpGuid) bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok(rc==DS_OK && primary!=NULL, + ok((rc==DS_OK && primary!=NULL) || + rc==DSERR_INVALIDPARAM, "IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc); if (rc==DS_OK && primary!=NULL) { diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index 2e02a92..b5dbf7b 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -575,6 +575,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid) wfx2=wfx; rc=IDirectSoundBuffer_SetFormat(primary,&wfx); ok(rc==DS_OK + || rc==DSERR_ALLOCATED || rc==DSERR_INVALIDPARAM, /* 2003 */ "IDirectSoundBuffer_SetFormat(%s) failed: %08x\n", format_string(&wfx), rc); @@ -725,11 +726,12 @@ static HRESULT test_secondary8(LPGUID lpGuid) bufdesc.lpwfxFormat=&wfx; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); if (wfx.wBitsPerSample != 8 && wfx.wBitsPerSample != 16) - ok(((rc == DSERR_CONTROLUNAVAIL || rc == DSERR_INVALIDCALL || rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary) + ok(((rc == DSERR_CONTROLUNAVAIL || + rc == DSERR_INVALIDCALL || + rc == DSERR_BADFORMAT || + rc == DSERR_INVALIDPARAM /* 2003 */) && !secondary) || rc == DS_OK, /* driver dependent? */ - "IDirectSound_CreateSoundBuffer() " - "should have returned (DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL) " - "and NULL, returned: %08x %p\n", rc, secondary); + "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", rc, secondary); else ok(rc==DS_OK && secondary!=NULL, "IDirectSound_CreateSoundBuffer() failed to create a secondary " @@ -772,7 +774,9 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.Format.cbSize = sizeof(wfxe) - sizeof(wfx); wfxe.SubFormat = GUID_NULL; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok((rc==DSERR_INVALIDPARAM || rc==DSERR_INVALIDCALL) && !secondary, + ok((rc==DSERR_INVALIDPARAM || + rc==DSERR_BADFORMAT || + rc==DSERR_INVALIDCALL) && !secondary, "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", rc, secondary); if (secondary) @@ -796,7 +800,8 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.Samples.wValidBitsPerSample = 0; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(rc==DS_OK && secondary, + ok((rc==DS_OK && secondary) || + rc==DSERR_BADFORMAT, "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", rc, secondary); if (secondary) @@ -807,7 +812,8 @@ static HRESULT test_secondary8(LPGUID lpGuid) wfxe.Samples.wValidBitsPerSample = wfxe.Format.wBitsPerSample; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(rc==DS_OK && secondary!=NULL, + ok((rc==DS_OK && secondary!=NULL) || + rc==DSERR_BADFORMAT, "IDirectSound_CreateSoundBuffer() failed to create a secondary " "buffer %08x\n",rc); -- 1.5.4.3