diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 11280d8561a..fd51d86290e 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -28,6 +28,34 @@ #include "initguid.h" #include "dsound.h" +static const unsigned int formats[][3]={ + { 8000, 8, 1}, + { 8000, 8, 2}, + { 8000, 16, 1}, + { 8000, 16, 2}, + {11025, 8, 1}, + {11025, 8, 2}, + {11025, 16, 1}, + {11025, 16, 2}, + {22050, 8, 1}, + {22050, 8, 2}, + {22050, 16, 1}, + {22050, 16, 2}, + {44100, 8, 1}, + {44100, 8, 2}, + {44100, 16, 1}, + {44100, 16, 2}, + {48000, 8, 1}, + {48000, 8, 2}, + {48000, 16, 1}, + {48000, 16, 2}, + {96000, 8, 1}, + {96000, 8, 2}, + {96000, 16, 1}, + {96000, 16, 2} +}; +#define NB_FORMATS (sizeof(formats)/sizeof(*formats)) + /* The time slice determines how often we will service the buffer and the * buffer will be four time slices long */ @@ -371,6 +399,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, DSBUFFERDESC bufdesc; WAVEFORMATEX wfx; DSCAPS dscaps; + int f; trace("Testing %s - %s : %s\n",lpcstrDescription,lpcstrModule,wine_dbgstr_guid(lpGuid)); rc=DirectSoundCreate(lpGuid,&dso,NULL); @@ -418,34 +447,21 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, goto EXIT; /* Testing secondary buffers */ - init_format(&wfx,11025,8,1); - bufdesc.dwSize=sizeof(bufdesc); - bufdesc.dwFlags=DSBCAPS_CTRLDEFAULT|DSBCAPS_GETCURRENTPOSITION2; - bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000; - bufdesc.dwReserved=0; - bufdesc.lpwfxFormat=&wfx; - trace(" Testing a secondary buffer at %ldx%dx%d\n", - wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels); - rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&dsbo,NULL); - ok(rc==DS_OK,"CreateSoundBuffer failed to create a secondary buffer 0x%lx\n",rc); - if (rc==DS_OK) { - test_buffer(dso,dsbo,0,winetest_interactive); - IDirectSoundBuffer_Release(dsbo); - } - - init_format(&wfx,48000,16,2); - bufdesc.dwSize=sizeof(bufdesc); - bufdesc.dwFlags=DSBCAPS_CTRLDEFAULT|DSBCAPS_GETCURRENTPOSITION2; - bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000; - bufdesc.dwReserved=0; - bufdesc.lpwfxFormat=&wfx; - trace(" Testing a secondary buffer at %ldx%dx%d\n", - wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels); - rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&dsbo,NULL); - ok(rc==DS_OK,"CreateSoundBuffer failed to create a secondary buffer 0x%lx\n",rc); - if (rc==DS_OK) { - test_buffer(dso,dsbo,0,winetest_interactive); - IDirectSoundBuffer_Release(dsbo); + for (f=0;f