Robert Reif : dsound: Add DirectSoundBuffer_Lock tests.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 5 12:10:38 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: a15ef7b18aef382c5f12bf26df277bc42d54472b
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=a15ef7b18aef382c5f12bf26df277bc42d54472b

Author: Robert Reif <reif at earthlink.net>
Date:   Sat Apr 29 10:14:40 2006 -0400

dsound: Add DirectSoundBuffer_Lock tests.

---

 dlls/dsound/tests/ds3d.c  |   16 ++++++++++++++++
 dlls/dsound/tests/ds3d8.c |   16 ++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c
index 0825d68..988e703 100644
--- a/dlls/dsound/tests/ds3d.c
+++ b/dlls/dsound/tests/ds3d.c
@@ -436,6 +436,8 @@ void test_buffer(LPDIRECTSOUND dso, LPDI
         LPDIRECTSOUND3DBUFFER buffer=NULL;
         DS3DBUFFER buffer_param;
         DWORD start_time,now;
+        LPVOID buffer1;
+        DWORD length1;
 
         if (winetest_interactive) {
             if (set_frequency)
@@ -559,6 +561,20 @@ void test_buffer(LPDIRECTSOUND dso, LPDI
             }
         }
 
+        /* try an offset past the end of the buffer */
+        rc = IDirectSoundBuffer_Lock(*dsbo, state.buffer_size, 0, &buffer1,
+                                      &length1, NULL, NULL,
+                                      DSBLOCK_ENTIREBUFFER);
+        ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
+           "returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc));
+
+        /* try a size larger than the buffer */
+        rc = IDirectSoundBuffer_Lock(*dsbo, 0, state.buffer_size + 1,
+                                     &buffer1, &length1, NULL, NULL,
+                                     DSBLOCK_FROMWRITECURSOR);
+        ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
+           "returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc));
+
         if (set_frequency)
             state.wave=wave_generate_la(&wfx,(duration*frequency)/wfx.nSamplesPerSec,&state.wave_len);
         else
diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c
index c0c5d51..1db0ad7 100644
--- a/dlls/dsound/tests/ds3d8.c
+++ b/dlls/dsound/tests/ds3d8.c
@@ -328,6 +328,8 @@ void test_buffer8(LPDIRECTSOUND8 dso, LP
         LPDIRECTSOUND3DBUFFER buffer=NULL;
         DS3DBUFFER buffer_param;
         DWORD start_time,now;
+        LPVOID buffer1;
+        DWORD length1;
 
         if (winetest_interactive) {
             trace("    Playing %g second 440Hz tone at %ldx%dx%d\n", duration,
@@ -445,6 +447,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LP
             }
         }
 
+        /* try an offset past the end of the buffer */
+        rc = IDirectSoundBuffer_Lock(*dsbo, state.buffer_size, 0, &buffer1,
+                                      &length1, NULL, NULL,
+                                      DSBLOCK_ENTIREBUFFER);
+        ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
+           "returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc));
+
+        /* try a size larger than the buffer */
+        rc = IDirectSoundBuffer_Lock(*dsbo, 0, state.buffer_size + 1,
+                                     &buffer1, &length1, NULL, NULL,
+                                     DSBLOCK_FROMWRITECURSOR);
+        ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
+           "returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc));
+
         state.wave=wave_generate_la(&wfx,duration,&state.wave_len);
 
         state.dsbo=*dsbo;




More information about the wine-cvs mailing list