Roy Shea : dsound/tests: Added additional tests of IDirectSound_CreateSoundBuffer.
Alexandre Julliard
julliard at winehq.org
Wed Jun 25 16:43:58 CDT 2008
Module: wine
Branch: master
Commit: 4a4d8caed3154726736e9ba7be62dd5dd6dd3cd0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4a4d8caed3154726736e9ba7be62dd5dd6dd3cd0
Author: Roy Shea <royshea at gmail.com>
Date: Tue Jun 24 10:29:50 2008 -0700
dsound/tests: Added additional tests of IDirectSound_CreateSoundBuffer.
---
dlls/dsound/tests/dsound.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c
index fc15bad..4b84eb9 100644
--- a/dlls/dsound/tests/dsound.c
+++ b/dlls/dsound/tests/dsound.c
@@ -401,16 +401,42 @@ static HRESULT test_primary(LPGUID lpGuid)
"IDirectSound_CreateSoundBuffer() should have failed: %s\n",
DXGetErrorString8(rc));
+ /* DSOUND: Error: NULL pointer is invalid */
/* 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=%p\n",DXGetErrorString8(rc),primary);
- ZeroMemory(&bufdesc, sizeof(bufdesc));
-
/* DSOUND: Error: Invalid size */
/* DSOUND: Error: Invalid buffer description */
+ primary=NULL;
+ ZeroMemory(&bufdesc, sizeof(bufdesc));
+ bufdesc.dwSize=sizeof(bufdesc)-1;
+ rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
+ ok(rc==DSERR_INVALIDPARAM && primary==0,
+ "IDirectSound_CreateSoundBuffer() should have failed: rc=%s,"
+ "primary=%p\n",DXGetErrorString8(rc),primary);
+
+ /* DSOUND: Error: DSBCAPS_PRIMARYBUFFER flag with non-NULL lpwfxFormat */
+ /* DSOUND: Error: Invalid buffer description pointer */
+ primary=NULL;
+ ZeroMemory(&bufdesc, sizeof(bufdesc));
+ bufdesc.dwSize=sizeof(bufdesc);
+ bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER;
+ bufdesc.lpwfxFormat=&wfx;
+ rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
+ ok(rc==DSERR_INVALIDPARAM && primary==0,
+ "IDirectSound_CreateSoundBuffer() should have failed: rc=%s,"
+ "primary=%p\n",DXGetErrorString8(rc),primary);
+
+ /* DSOUND: Error: No DSBCAPS_PRIMARYBUFFER flag with NULL lpwfxFormat */
+ /* DSOUND: Error: Invalid buffer description pointer */
+ primary=NULL;
+ ZeroMemory(&bufdesc, sizeof(bufdesc));
+ bufdesc.dwSize=sizeof(bufdesc);
+ bufdesc.dwFlags=0;
+ bufdesc.lpwfxFormat=NULL;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DSERR_INVALIDPARAM && primary==0,
"IDirectSound_CreateSoundBuffer() should have failed: rc=%s,"
More information about the wine-cvs
mailing list