more dsound tests cleanup
Robert Reif
reif at earthlink.net
Thu Aug 12 21:57:23 CDT 2004
More dsound tests error message cleanups.
Only display verbose information when in interactive mode.
-------------- next part --------------
Index: dlls/dsound/tests/ds3d.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/ds3d.c,v
retrieving revision 1.8
diff -u -r1.8 ds3d.c
--- dlls/dsound/tests/ds3d.c 12 Aug 2004 03:29:39 -0000 1.8
+++ dlls/dsound/tests/ds3d.c 13 Aug 2004 02:51:51 -0000
@@ -956,7 +956,7 @@
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
@@ -987,14 +987,14 @@
ZeroMemory(&dscaps, sizeof(dscaps));
dscaps.dwSize=sizeof(dscaps);
rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -1106,7 +1106,7 @@
{
HRESULT rc;
rc=DirectSoundEnumerateA(&dsenum_callback,NULL);
- ok(rc==DS_OK,"DirectSoundEnumerate() failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
}
START_TEST(ds3d)
Index: dlls/dsound/tests/ds3d8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/ds3d8.c,v
retrieving revision 1.2
diff -u -r1.2 ds3d8.c
--- dlls/dsound/tests/ds3d8.c 9 Aug 2004 19:49:12 -0000 1.2
+++ dlls/dsound/tests/ds3d8.c 13 Aug 2004 02:51:51 -0000
@@ -61,7 +61,8 @@
rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size,
&ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"Lock: 0x%lx\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc!=DS_OK)
return -1;
@@ -73,7 +74,8 @@
}
state->offset=state->written % state->buffer_size;
rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"Unlock: 0x%lx\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc!=DS_OK)
return -1;
return size;
@@ -88,7 +90,8 @@
rc=IDirectSoundBuffer_Lock(state->dsbo,state->offset,size,
&ptr1,&len1,&ptr2,&len2,0);
- ok(rc==DS_OK,"Lock: 0x%lx\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_Lock() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc!=DS_OK)
return -1;
@@ -99,7 +102,8 @@
}
state->offset=(state->offset+size) % state->buffer_size;
rc=IDirectSoundBuffer_Unlock(state->dsbo,ptr1,len1,ptr2,len2);
- ok(rc==DS_OK,"Unlock: 0x%lx\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_Unlock() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc!=DS_OK)
return -1;
return size;
@@ -111,7 +115,8 @@
HRESULT rc;
rc=IDirectSoundBuffer_GetCurrentPosition(state->dsbo,&play_pos,NULL);
- ok(rc==DS_OK,"GetCurrentPosition: %lx\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_GetCurrentPosition() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc!=DS_OK) {
goto STOP;
}
@@ -125,7 +130,8 @@
if (winetest_debug > 1)
trace("buf size=%ld last_play_pos=%ld play_pos=%ld played=%ld / %ld\n",
- state->buffer_size,last_play_pos,play_pos,state->played,state->wave_len);
+ state->buffer_size,last_play_pos,play_pos,state->played,
+ state->wave_len);
if (state->played>state->wave_len)
{
@@ -169,7 +175,8 @@
if (winetest_debug > 1)
trace("stopping playback\n");
rc=IDirectSoundBuffer_Stop(state->dsbo);
- ok(rc==DS_OK,"Stop failed: rc=%ld\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_Stop() failed: %s\n",
+ DXGetErrorString8(rc));
return 0;
}
@@ -198,7 +205,7 @@
dsbcaps.dwSize=sizeof(dsbcaps);
rc=IDirectSoundBuffer_GetCaps(dsbo,&dsbcaps);
ok(rc==DS_OK,"GetCaps failed: 0x%lx\n",rc);
- if (rc==DS_OK) {
+ if (rc==DS_OK && winetest_interactive) {
trace(" Caps: flags=0x%08lx size=%ld\n",dsbcaps.dwFlags,
dsbcaps.dwBufferBytes);
}
@@ -212,7 +219,7 @@
rc=IDirectSoundBuffer_GetFormat(dsbo,&wfx,sizeof(wfx),NULL);
ok(rc==DS_OK,"GetFormat failed: 0x%lx\n",rc);
- if (rc==DS_OK && is_primary) {
+ if (rc==DS_OK && is_primary && winetest_interactive) {
trace("Primary buffer default format: tag=0x%04x %ldx%dx%d avg.B/s=%ld align=%d\n",
wfx.wFormatTag,wfx.nSamplesPerSec,wfx.wBitsPerSample,
wfx.nChannels,wfx.nAvgBytesPerSec,wfx.nBlockAlign);
@@ -289,8 +296,10 @@
DS3DBUFFER buffer_param;
DWORD start_time,now;
- trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration,
- wfx.nSamplesPerSec, wfx.wBitsPerSample,wfx.nChannels);
+ if (winetest_interactive) {
+ trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration,
+ wfx.nSamplesPerSec, wfx.wBitsPerSample,wfx.nChannels);
+ }
if (is_primary) {
/* We must call SetCooperativeLevel to be allowed to call Lock */
@@ -524,14 +533,16 @@
bufdesc.dwFlags|=(DSBCAPS_CTRLFREQUENCY|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN);
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
bufdesc.lpwfxFormat=&wfx;
- trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n",
- has_3dbuffer?"3D ":"",
- has_duplicate?"duplicated ":"",
- listener!=NULL||move_sound?"with ":"",
- move_listener?"moving ":"",
- listener!=NULL?"listener ":"",
- listener&&move_sound?"and moving sound ":move_sound?"moving sound ":"",
- wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+ if (winetest_interactive) {
+ trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n",
+ has_3dbuffer?"3D ":"",
+ has_duplicate?"duplicated ":"",
+ listener!=NULL||move_sound?"with ":"",
+ move_listener?"moving ":"",
+ listener!=NULL?"listener ":"",
+ listener&&move_sound?"and moving sound ":move_sound?"moving sound ":"",
+ wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+ }
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,"CreateSoundBuffer failed to create a 3D secondary buffer 0x%lx\n",rc);
if (rc==DS_OK && secondary!=NULL) {
@@ -889,7 +900,7 @@
{
HRESULT rc;
rc=DirectSoundEnumerateA(&dsenum_callback,NULL);
- ok(rc==DS_OK,"DirectSoundEnumerate failed: %ld\n",rc);
+ ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
}
START_TEST(ds3d8)
Index: dlls/dsound/tests/dsound.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound.c,v
retrieving revision 1.35
diff -u -r1.35 dsound.c
--- dlls/dsound/tests/dsound.c 12 Aug 2004 03:29:39 -0000 1.35
+++ dlls/dsound/tests/dsound.c 13 Aug 2004 02:51:52 -0000
@@ -101,14 +101,16 @@
/* DSOUND: Error: Invalid caps buffer */
rc=IDirectSound_GetCaps(dso,0);
ok(rc==DSERR_INVALIDPARAM,"IDirectSound_GetCaps(NULL) "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
ZeroMemory(&dscaps, sizeof(dscaps));
/* DSOUND: Error: Invalid caps buffer */
rc=IDirectSound_GetCaps(dso,&dscaps);
ok(rc==DSERR_INVALIDPARAM,"IDirectSound_GetCaps() "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
dscaps.dwSize=sizeof(dscaps);
@@ -129,7 +131,8 @@
rc=IDirectSound_GetSpeakerConfig(dso,0);
ok(rc==DSERR_INVALIDPARAM,"IDirectSound_GetSpeakerConfig(NULL) "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
rc=IDirectSound_GetSpeakerConfig(dso,&speaker_config);
ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %s\n",
@@ -238,12 +241,12 @@
/* DSOUND: Error: Invalid interface buffer */
rc=DirectSoundCreate(lpGuid,0,NULL);
- ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate should have failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate() should have returned "
+ "DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -260,25 +263,25 @@
/* Create a DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
LPDIRECTSOUND dso1=NULL;
/* Create a second DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso1,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
/* Release the second DirectSound object */
ref=IDirectSound_Release(dso1);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",
- ref);
+ ok(ref==0,"IDirectSound_Release() has %d references, should have "
+ "0\n",ref);
ok(dso!=dso1,"DirectSound objects should be unique: "
"dso=0x%08lx,dso1=0x%08lx\n",(DWORD)dso,(DWORD)dso1);
}
/* Release the first DirectSound object */
ref=IDirectSound_Release(dso);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",
+ ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",
ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -287,7 +290,7 @@
/* Create a DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
LPDIRECTSOUNDBUFFER secondary;
DSBUFFERDESC bufdesc;
@@ -301,26 +304,26 @@
bufdesc.lpwfxFormat=&wfx;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a secondary buffer "
- "%s\n",DXGetErrorString8(rc));
+ "IDirectSound_CreateSoundBuffer() failed to create a secondary "
+ "buffer %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && secondary!=NULL) {
LPDIRECTSOUND3DBUFFER buffer3d;
rc=IDirectSound_QueryInterface(secondary, &IID_IDirectSound3DBuffer,
(void **)&buffer3d);
- ok(rc==DS_OK && buffer3d!=NULL,"QueryInterface failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==DS_OK && buffer3d!=NULL,"IDirectSound_QueryInterface() "
+ "failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && buffer3d!=NULL) {
ref=IDirectSound3DBuffer_AddRef(buffer3d);
- ok(ref==2,"IDirectSound3DBuffer_AddRef has %d references, "
+ ok(ref==2,"IDirectSound3DBuffer_AddRef() has %d references, "
"should have 2\n",ref);
}
ref=IDirectSoundBuffer_AddRef(secondary);
- ok(ref==2,"IDirectSoundBuffer_AddRef has %d references, "
+ ok(ref==2,"IDirectSoundBuffer_AddRef() has %d references, "
"should have 2\n",ref);
}
/* release with buffer */
ref=IDirectSound_Release(dso);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",
+ ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",
ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -341,7 +344,7 @@
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -349,27 +352,27 @@
ZeroMemory(&dscaps, sizeof(dscaps));
dscaps.dwSize=sizeof(dscaps);
rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* DSOUND: Error: Invalid buffer description pointer */
rc=IDirectSound_CreateSoundBuffer(dso,0,0,NULL);
ok(rc==DSERR_INVALIDPARAM,
- "IDirectSound_CreateSoundBuffer should have failed: %s\n",
+ "IDirectSound_CreateSoundBuffer() should have failed: %s\n",
DXGetErrorString8(rc));
/* DSOUND: Error: Invalid buffer description pointer */
rc=IDirectSound_CreateSoundBuffer(dso,0,&primary,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
- "IDirectSound_CreateSoundBuffer should have failed: rc=%s,dsbo=0x%lx\n",
- DXGetErrorString8(rc),(DWORD)primary);
+ "IDirectSound_CreateSoundBuffer() should have failed: rc=%s,"
+ "dsbo=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary);
/* DSOUND: Error: Invalid buffer description pointer */
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,0,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
- "IDirectSound_CreateSoundBuffer should have failed: rc=%s,dsbo=0x%lx\n",
- DXGetErrorString8(rc),(DWORD)primary);
+ "IDirectSound_CreateSoundBuffer() should have failed: rc=%s,"
+ "dsbo=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary);
ZeroMemory(&bufdesc, sizeof(bufdesc));
@@ -377,13 +380,13 @@
/* DSOUND: Error: Invalid buffer description */
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
- "IDirectSound_CreateSoundBuffer should have failed: rc=%s,"
+ "IDirectSound_CreateSoundBuffer() should have failed: rc=%s,"
"primary=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary);
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -395,8 +398,8 @@
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a primary buffer: %s\n",
- DXGetErrorString8(rc));
+ "IDirectSound_CreateSoundBuffer() failed to create a primary buffer: "
+ "%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
LONG vol;
@@ -405,21 +408,21 @@
* Any changes made to the buffer description will be ignored. */
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&second,NULL);
ok(rc==DS_OK && second==primary,
- "IDirectSound_CreateSoundBuffer should have returned original "
+ "IDirectSound_CreateSoundBuffer() should have returned original "
"primary buffer: %s\n",DXGetErrorString8(rc));
ref=IDirectSoundBuffer_Release(second);
- ok(ref==1,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==1,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 1\n",ref);
/* Try to duplicate a primary buffer */
/* DSOUND: Error: Can't duplicate primary buffers */
rc=IDirectSound_DuplicateSoundBuffer(dso,primary,&third);
/* rc=0x88780032 */
- ok(rc!=DS_OK,"IDirectSound_DuplicateSoundBuffer primary buffer should "
- "have failed %s\n",DXGetErrorString8(rc));
+ ok(rc!=DS_OK,"IDirectSound_DuplicateSoundBuffer() primary buffer "
+ "should have failed %s\n",DXGetErrorString8(rc));
rc=IDirectSoundBuffer_GetVolume(primary,&vol);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume failed: %s\n",
+ ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %s\n",
DXGetErrorString8(rc));
if (winetest_interactive) {
@@ -434,19 +437,19 @@
!(dscaps.dwFlags & DSCAPS_EMULDRIVER),5.0,0,0,0,0);
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);
}
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
ref=IDirectSound_Release(dso);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -469,7 +472,7 @@
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -477,14 +480,14 @@
ZeroMemory(&dscaps, sizeof(dscaps));
dscaps.dwSize=sizeof(dscaps);
rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -494,15 +497,16 @@
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a primary buffer %s\n",
- DXGetErrorString8(rc));
+ "IDirectSound_CreateSoundBuffer() failed to create a primary buffer "
+ "%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
for (f=0;f<NB_FORMATS;f++) {
/* We must call SetCooperativeLevel to be allowed to call SetFormat */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"SetCooperativeLevel failed: 0x%0lx\n",rc);
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -510,7 +514,7 @@
formats[f][2]);
wfx2=wfx;
rc=IDirectSoundBuffer_SetFormat(primary,&wfx);
- ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat failed: %s\n",
+ ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat() failed: %s\n",
DXGetErrorString8(rc));
/* There is no garantee that SetFormat will actually change the
@@ -518,7 +522,8 @@
* supports. So we must re-query the format.
*/
rc=IDirectSoundBuffer_GetFormat(primary,&wfx,sizeof(wfx),NULL);
- ok(rc==DS_OK,"GetFormat failed: 0x%lx\n",rc);
+ ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n",
+ DXGetErrorString8(rc));
if (rc==DS_OK &&
(wfx.wFormatTag!=wfx2.wFormatTag ||
wfx.nSamplesPerSec!=wfx2.nSamplesPerSec ||
@@ -536,7 +541,8 @@
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"SetCooperativeLevel failed: 0x%0lx\n",rc);
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
+ DXGetErrorString8(rc));
init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2);
@@ -554,7 +560,7 @@
}
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a secondary "
+ "IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && secondary!=NULL) {
@@ -562,25 +568,25 @@
winetest_interactive,1.0,0,NULL,0,0);
ref=IDirectSoundBuffer_Release(secondary);
- ok(ref==0,"IDirectSoundBuffer_Release has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() has %d references, "
"should have 0\n",ref);
}
}
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);
}
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
ref=IDirectSound_Release(dso);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -600,7 +606,7 @@
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -608,14 +614,14 @@
ZeroMemory(&dscaps, sizeof(dscaps));
dscaps.dwSize=sizeof(dscaps);
rc=IDirectSound_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound_GetCaps failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"IDirectSound_GetCaps() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -625,8 +631,8 @@
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a primary buffer %s\n",
- DXGetErrorString8(rc));
+ "IDirectSound_CreateSoundBuffer() failed to create a primary buffer "
+ "%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
for (f=0;f<NB_FORMATS;f++) {
@@ -644,7 +650,7 @@
}
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a secondary "
+ "IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && secondary!=NULL) {
@@ -652,25 +658,25 @@
winetest_interactive,1.0,0,NULL,0,0);
ref=IDirectSoundBuffer_Release(secondary);
- ok(ref==0,"IDirectSoundBuffer_Release has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() has %d references, "
"should have 0\n",ref);
}
}
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);
}
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
ref=IDirectSound_Release(dso);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -693,7 +699,7 @@
{
HRESULT rc;
rc=DirectSoundEnumerateA(&dsenum_callback,NULL);
- ok(rc==DS_OK,"DirectSoundEnumerate failed: %ld\n",rc);
+ ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
}
START_TEST(dsound)
Index: dlls/dsound/tests/dsound8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound8.c,v
retrieving revision 1.3
diff -u -r1.3 dsound8.c
--- dlls/dsound/tests/dsound8.c 9 Aug 2004 19:49:12 -0000 1.3
+++ dlls/dsound/tests/dsound8.c 13 Aug 2004 02:51:52 -0000
@@ -68,7 +68,8 @@
rc=IDirectSound8_QueryInterface(dso,&IID_IDirectSound8,(LPVOID*)&ds8);
ok(rc==DS_OK,"IDirectSound8_QueryInterface(IID_IDirectSound8) "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
if (rc==DS_OK)
IDirectSound8_Release(ds8);
@@ -107,14 +108,16 @@
/* DSOUND: Error: Invalid caps buffer */
rc=IDirectSound8_GetCaps(dso,0);
ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_GetCaps() "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
ZeroMemory(&dscaps, sizeof(dscaps));
/* DSOUND: Error: Invalid caps buffer */
rc=IDirectSound8_GetCaps(dso,&dscaps);
ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_GetCaps() "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
dscaps.dwSize=sizeof(dscaps);
@@ -135,7 +138,8 @@
rc=IDirectSound8_GetSpeakerConfig(dso,0);
ok(rc==DSERR_INVALIDPARAM,"IDirectSound8_GetSpeakerConfig(NULL) "
- "should have failed: %s\n",DXGetErrorString8(rc));
+ "should have returned DSERR_INVALIDPARAM, returned: %s\n",
+ DXGetErrorString8(rc));
rc=IDirectSound8_GetSpeakerConfig(dso,&speaker_config);
ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %s\n",
@@ -175,7 +179,7 @@
/* try the COM class factory method of creation with no device specified */
rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectSound8, (void**)&dso);
- ok(rc==S_OK,"CoCreateInstance failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==S_OK,"CoCreateInstance() failed: %s\n",DXGetErrorString8(rc));
if (dso)
IDirectSound8_test(dso, FALSE, NULL);
@@ -215,19 +219,19 @@
/* try with no device specified */
rc=DirectSoundCreate8(NULL,&dso,NULL);
- ok(rc==S_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with default playback device specified */
rc=DirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
- ok(rc==S_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with default voice playback device specified */
rc=DirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
- ok(rc==S_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (dso)
IDirectSound8_test(dso, TRUE, NULL);
@@ -245,12 +249,12 @@
/* DSOUND: Error: Invalid interface buffer */
rc=DirectSoundCreate8(lpGuid,0,NULL);
- ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8 should have failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned "
+ "DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
/* Create the DirectSound8 object */
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -267,17 +271,17 @@
/* Create a DirectSound8 object */
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
LPDIRECTSOUND8 dso1=NULL;
/* Create a second DirectSound8 object */
rc=DirectSoundCreate8(lpGuid,&dso1,NULL);
- ok(rc==DS_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
/* Release the second DirectSound8 object */
ref=IDirectSound8_Release(dso1);
- ok(ref==0,"IDirectSound8_Release has %d references, "
+ ok(ref==0,"IDirectSound8_Release() has %d references, "
"should have 0\n",ref);
ok(dso!=dso1,"DirectSound8 objects should be unique: "
"dso=0x%08lx,dso1=0x%08lx\n",(DWORD)dso,(DWORD)dso1);
@@ -285,7 +289,7 @@
/* Release the first DirectSound8 object */
ref=IDirectSound8_Release(dso);
- ok(ref==0,"IDirectSound8_Release has %d references, should have 0\n",
+ ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",
ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -294,7 +298,7 @@
/* Create a DirectSound8 object */
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
LPDIRECTSOUNDBUFFER secondary;
DSBUFFERDESC bufdesc;
@@ -308,8 +312,8 @@
bufdesc.lpwfxFormat=&wfx;
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
- "IDirectSound8_CreateSoundBuffer failed to create a secondary "
- "buffer %s\n",DXGetErrorString8(rc));
+ "IDirectSound8_CreateSoundBuffer() failed to create a secondary "
+ "buffer: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && secondary!=NULL) {
LPDIRECTSOUND3DBUFFER buffer3d;
LPDIRECTSOUNDBUFFER8 buffer8;
@@ -317,11 +321,11 @@
&IID_IDirectSound3DBuffer,
(void **)&buffer3d);
ok(rc==DS_OK && buffer3d!=NULL,
- "IDirectSound8_QueryInterface failed: %s\n",
+ "IDirectSound8_QueryInterface() failed: %s\n",
DXGetErrorString8(rc));
if (rc==DS_OK && buffer3d!=NULL) {
ref=IDirectSound3DBuffer_AddRef(buffer3d);
- ok(ref==2,"IDirectSound3DBuffer_AddRef has %d references, "
+ ok(ref==2,"IDirectSound3DBuffer_AddRef() has %d references, "
"should have 2\n",ref);
}
rc=IDirectSound8_QueryInterface(secondary,
@@ -329,16 +333,16 @@
(void **)&buffer8);
if (rc==DS_OK && buffer8!=NULL) {
ref=IDirectSoundBuffer8_AddRef(buffer8);
- ok(ref==3,"IDirectSoundBuffer8_AddRef has %d references, "
+ ok(ref==3,"IDirectSoundBuffer8_AddRef() has %d references, "
"should have 3\n",ref);
}
ref=IDirectSoundBuffer_AddRef(secondary);
- ok(ref==4,"IDirectSoundBuffer_AddRef has %d references, "
+ ok(ref==4,"IDirectSoundBuffer_AddRef() has %d references, "
"should have 4\n",ref);
}
/* release with buffer */
ref=IDirectSound8_Release(dso);
- ok(ref==0,"IDirectSound8_Release has %d references, should have 0\n",
+ ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",
ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -374,20 +378,21 @@
/* DSOUND: Error: Invalid buffer description pointer */
rc=IDirectSound8_CreateSoundBuffer(dso,0,0,NULL);
ok(rc==DSERR_INVALIDPARAM,
- "IDirectSound8_CreateSoundBuffer should have failed: %s\n",
- DXGetErrorString8(rc));
+ "IDirectSound8_CreateSoundBuffer should have returned "
+ "DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
/* DSOUND: Error: Invalid buffer description pointer */
rc=IDirectSound8_CreateSoundBuffer(dso,0,&primary,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
- "IDirectSound8_CreateSoundBuffer should have failed: rc=%s,dsbo=0x%lx\n",
+ "IDirectSound8_CreateSoundBuffer() should have returned "
+ "DSERR_INVALIDPARAM, returned: rc=%s,dsbo=0x%lx\n",
DXGetErrorString8(rc),(DWORD)primary);
/* DSOUND: Error: Invalid buffer description pointer */
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,0,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
- "IDirectSound8_CreateSoundBuffer should have failed: rc=%s,dsbo=0x%lx\n",
- DXGetErrorString8(rc),(DWORD)primary);
+ "IDirectSound8_CreateSoundBuffer() should have failed: rc=%s,"
+ "dsbo=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary);
ZeroMemory(&bufdesc, sizeof(bufdesc));
@@ -395,13 +400,13 @@
/* DSOUND: Error: Invalid buffer description */
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
- "IDirectSound8_CreateSoundBuffer should have failed: rc=%s,"
+ "IDirectSound8_CreateSoundBuffer() should have failed: rc=%s,"
"primary=0x%lx\n",DXGetErrorString8(rc),(DWORD)primary);
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -413,7 +418,7 @@
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME;
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
- "IDirectSound8_CreateSoundBuffer failed to create a primary buffer: "
+ "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: "
"%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
LONG vol;
@@ -423,21 +428,21 @@
* Any changes made to the buffer description will be ignored. */
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&second,NULL);
ok(rc==DS_OK && second==primary,
- "IDirectSound8_CreateSoundBuffer should have returned original "
+ "IDirectSound8_CreateSoundBuffer() should have returned original "
"primary buffer: %s\n",DXGetErrorString8(rc));
ref=IDirectSoundBuffer_Release(second);
- ok(ref==1,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==1,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 1\n",ref);
/* Try to duplicate a primary buffer */
/* DSOUND: Error: Can't duplicate primary buffers */
rc=IDirectSound8_DuplicateSoundBuffer(dso,primary,&third);
/* rc=0x88780032 */
- ok(rc!=DS_OK,"IDirectSound8_DuplicateSoundBuffer primary buffer should "
- "have failed %s\n",DXGetErrorString8(rc));
+ ok(rc!=DS_OK,"IDirectSound8_DuplicateSoundBuffer() primary buffer "
+ "should have failed %s\n",DXGetErrorString8(rc));
rc=IDirectSoundBuffer_GetVolume(primary,&vol);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume failed: %s\n",
+ ok(rc==DS_OK,"IDirectSoundBuffer_GetVolume() failed: %s\n",
DXGetErrorString8(rc));
if (winetest_interactive) {
@@ -452,19 +457,19 @@
!(dscaps.dwFlags & DSCAPS_EMULDRIVER),5.0,0,0,0,0);
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);
}
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
ref=IDirectSound8_Release(dso);
- ok(ref==0,"IDirectSound8_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -487,7 +492,7 @@
/* Create the DirectSound object */
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -495,14 +500,14 @@
ZeroMemory(&dscaps, sizeof(dscaps));
dscaps.dwSize=sizeof(dscaps);
rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -512,15 +517,15 @@
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
- "IDirectSound8_CreateSoundBuffer failed to create a primary buffer %s\n",
- DXGetErrorString8(rc));
+ "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer "
+ "%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
for (f=0;f<NB_FORMATS;f++) {
/* We must call SetCooperativeLevel to be allowed to call SetFormat */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -529,7 +534,7 @@
formats[f][2]);
wfx2=wfx;
rc=IDirectSoundBuffer_SetFormat(primary,&wfx);
- ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat failed: %s\n",
+ ok(rc==DS_OK,"IDirectSoundBuffer_SetFormat() failed: %s\n",
DXGetErrorString8(rc));
/* There is no garantee that SetFormat will actually change the
@@ -537,7 +542,7 @@
* supports. So we must re-query the format.
*/
rc=IDirectSoundBuffer_GetFormat(primary,&wfx,sizeof(wfx),NULL);
- ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat failed: %s\n",
+ ok(rc==DS_OK,"IDirectSoundBuffer_GetFormat() failed: %s\n",
DXGetErrorString8(rc));
if (rc==DS_OK &&
(wfx.wFormatTag!=wfx2.wFormatTag ||
@@ -556,7 +561,7 @@
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
init_format(&wfx2,WAVE_FORMAT_PCM,11025,16,2);
@@ -567,13 +572,15 @@
bufdesc.dwFlags=DSBCAPS_GETCURRENTPOSITION2;
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
bufdesc.lpwfxFormat=&wfx2;
- trace(" Testing a primary buffer at %ldx%dx%d with a "
- "secondary buffer at %ldx%dx%d\n",
- wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
- wfx2.nSamplesPerSec,wfx2.wBitsPerSample,wfx2.nChannels);
+ if (winetest_interactive) {
+ trace(" Testing a primary buffer at %ldx%dx%d with a "
+ "secondary buffer at %ldx%dx%d\n",
+ wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
+ wfx2.nSamplesPerSec,wfx2.wBitsPerSample,wfx2.nChannels);
+ }
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
- "IDirectSound_CreateSoundBuffer failed to create a secondary "
+ "IDirectSound_CreateSoundBuffer() failed to create a secondary "
"buffer %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && secondary!=NULL) {
@@ -581,25 +588,25 @@
winetest_interactive,1.0,0,NULL,0,0);
ref=IDirectSoundBuffer_Release(secondary);
- ok(ref==0,"IDirectSoundBuffer_Release has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() has %d references, "
"should have 0\n",ref);
}
}
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);
}
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
ref=IDirectSound8_Release(dso);
- ok(ref==0,"IDirectSound8_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -619,7 +626,7 @@
/* Create the DirectSound object */
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate8 failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
@@ -627,14 +634,14 @@
ZeroMemory(&dscaps, sizeof(dscaps));
dscaps.dwSize=sizeof(dscaps);
rc=IDirectSound8_GetCaps(dso,&dscaps);
- ok(rc==DS_OK,"IDirectSound8_GetCaps failed: %s\n",DXGetErrorString8(rc));
+ ok(rc==DS_OK,"IDirectSound8_GetCaps() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* We must call SetCooperativeLevel before creating primary buffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -644,8 +651,8 @@
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
- "IDirectSound8_CreateSoundBuffer failed to create a primary buffer %s\n",
- DXGetErrorString8(rc));
+ "IDirectSound8_CreateSoundBuffer() failed to create a primary buffer "
+ "%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
for (f=0;f<NB_FORMATS;f++) {
@@ -657,37 +664,39 @@
bufdesc.dwFlags=DSBCAPS_GETCURRENTPOSITION2;
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
bufdesc.lpwfxFormat=&wfx;
- trace(" Testing a secondary buffer at %ldx%dx%d\n",
- wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+ if (winetest_interactive) {
+ trace(" Testing a secondary buffer at %ldx%dx%d\n",
+ wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+ }
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
- "IDirectSound8_CreateSoundBuffer failed to create a secondary "
- "buffer %s\n",DXGetErrorString8(rc));
+ "IDirectSound8_CreateSoundBuffer() failed to create a secondary "
+ "buffer: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && secondary!=NULL) {
test_buffer8(dso,secondary,0,FALSE,0,FALSE,0,
winetest_interactive,1.0,0,NULL,0,0);
ref=IDirectSoundBuffer_Release(secondary);
- ok(ref==0,"IDirectSoundBuffer_Release has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() has %d references, "
"should have 0\n",ref);
}
}
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, "
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);
}
/* Set the CooperativeLevel back to normal */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_NORMAL */
rc=IDirectSound8_SetCooperativeLevel(dso,get_hwnd(),DSSCL_NORMAL);
- ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel failed: %s\n",
+ ok(rc==DS_OK,"IDirectSound8_SetCooperativeLevel() failed: %s\n",
DXGetErrorString8(rc));
EXIT:
ref=IDirectSound8_Release(dso);
- ok(ref==0,"IDirectSound8_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
@@ -710,7 +719,7 @@
{
HRESULT rc;
rc=DirectSoundEnumerateA(&dsenum_callback,NULL);
- ok(rc==DS_OK,"DirectSoundEnumerate failed: %ld\n",rc);
+ ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
}
START_TEST(dsound8)
Index: dlls/dsound/tests/propset.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/propset.c,v
retrieving revision 1.6
diff -u -r1.6 propset.c
--- dlls/dsound/tests/propset.c 22 Jul 2004 19:40:44 -0000 1.6
+++ dlls/dsound/tests/propset.c 13 Aug 2004 02:51:53 -0000
@@ -31,6 +31,7 @@
#include "dsound.h"
#include "initguid.h"
#include "dsconf.h"
+#include "dxerr8.h"
#ifndef DSBCAPS_CTRLDEFAULT
#define DSBCAPS_CTRLDEFAULT DSBCAPS_CTRLFREQUENCY|DSBCAPS_CTRLPAN|DSBCAPS_CTRLVOLUME
@@ -216,14 +217,14 @@
int ref;
rc=DirectSoundCreate(lpGuid,&dso,NULL);
- ok(rc==DS_OK,"DirectSoundCreate failed: 0x%lx\n",rc);
+ ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY);
- ok(rc==DS_OK,"SetCooperativeLevel failed: 0x%lx\n",rc);
+ ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %s\n",DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT;
@@ -233,7 +234,7 @@
bufdesc.dwSize=sizeof(bufdesc);
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_LOCHARDWARE|DSBCAPS_CTRL3D;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
- ok(rc==DS_OK&&primary!=NULL,"CreateSoundBuffer failed to create a hardware 3D primary buffer: 0x%lx\n",rc);
+ ok(rc==DS_OK&&primary!=NULL,"IDirectSound_CreateSoundBuffer() failed to create a hardware 3D primary buffer: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK&&primary!=NULL) {
ZeroMemory(&wfx, sizeof(wfx));
wfx.wFormatTag=WAVE_FORMAT_PCM;
@@ -250,7 +251,7 @@
trace(" Testing a secondary buffer at %ldx%dx%d\n",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
- ok(rc==DS_OK&&secondary!=NULL,"CreateSoundBuffer failed to create a secondary buffer 0x%lx\n",rc);
+ ok(rc==DS_OK&&secondary!=NULL,"IDirectSound_CreateSoundBuffer() failed to create a secondary buffer %s\n",DXGetErrorString8(rc));
if (rc==DS_OK&&secondary!=NULL) {
IKsPropertySet * pPropertySet=NULL;
rc=IDirectSoundBuffer_QueryInterface(secondary,&IID_IKsPropertySet,(void **)&pPropertySet);
@@ -291,21 +292,21 @@
trace(" DSPROPSETID_ZOOMFX_BufferProperties not supported\n");
ref=IKsPropertySet_Release(pPropertySet);
/* try a few common ones */
- ok(ref==0,"IKsPropertySet_Release secondary has %d references, should have 0\n",ref);
+ ok(ref==0,"IKsPropertySet_Release() secondary has %d references, should have 0\n",ref);
} else
trace(" Doesn't support property sets\n");
ref=IDirectSoundBuffer_Release(secondary);
- ok(ref==0,"IDirectSoundBuffer_Release secondary has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSoundBuffer_Release() secondary has %d references, should have 0\n",ref);
}
ref=IDirectSoundBuffer_Release(primary);
- ok(ref==0,"IDirectSoundBuffer_Release primary has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, should have 0\n",ref);
}
EXIT:
if (dso!=NULL) {
ref=IDirectSound_Release(dso);
- ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
+ ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",ref);
}
return 1;
}
@@ -314,7 +315,7 @@
{
HRESULT rc;
rc=DirectSoundEnumerateA(&dsenum_callback,NULL);
- ok(rc==DS_OK,"DirectSoundEnumerate failed: %ld\n",rc);
+ ok(rc==DS_OK,"DirectSoundEnumerateA() failed: %s\n",DXGetErrorString8(rc));
}
START_TEST(propset)
More information about the wine-patches
mailing list