Commit a15ef7b1 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

dsound: Add DirectSoundBuffer_Lock tests.

parent b06a0609
...@@ -436,6 +436,8 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, ...@@ -436,6 +436,8 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
LPDIRECTSOUND3DBUFFER buffer=NULL; LPDIRECTSOUND3DBUFFER buffer=NULL;
DS3DBUFFER buffer_param; DS3DBUFFER buffer_param;
DWORD start_time,now; DWORD start_time,now;
LPVOID buffer1;
DWORD length1;
if (winetest_interactive) { if (winetest_interactive) {
if (set_frequency) if (set_frequency)
...@@ -559,6 +561,20 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo, ...@@ -559,6 +561,20 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
} }
} }
/* 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) if (set_frequency)
state.wave=wave_generate_la(&wfx,(duration*frequency)/wfx.nSamplesPerSec,&state.wave_len); state.wave=wave_generate_la(&wfx,(duration*frequency)/wfx.nSamplesPerSec,&state.wave_len);
else else
......
...@@ -328,6 +328,8 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, ...@@ -328,6 +328,8 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
LPDIRECTSOUND3DBUFFER buffer=NULL; LPDIRECTSOUND3DBUFFER buffer=NULL;
DS3DBUFFER buffer_param; DS3DBUFFER buffer_param;
DWORD start_time,now; DWORD start_time,now;
LPVOID buffer1;
DWORD length1;
if (winetest_interactive) { if (winetest_interactive) {
trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration, trace(" Playing %g second 440Hz tone at %ldx%dx%d\n", duration,
...@@ -445,6 +447,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo, ...@@ -445,6 +447,20 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
} }
} }
/* 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.wave=wave_generate_la(&wfx,duration,&state.wave_len);
state.dsbo=*dsbo; state.dsbo=*dsbo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment