Commit 7d9340b8 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Fix tests to work with drivers that don't support a primary buffer.

parent 0aec9906
......@@ -674,11 +674,12 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
else
bufdesc.dwFlags|=(DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN);
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() "
"failed to create a %sprimary buffer: %s\n",has_3d?"3D ":"",
DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound_CreateSoundBuffer() failed to create a %sprimary buffer: "
"%s\n",has_3d?"3D ":"", DXGetErrorString8(rc));
if (rc==DSERR_CONTROLUNAVAIL)
trace(" No Primary\n");
else if (rc==DS_OK && primary!=NULL) {
rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
DXGetErrorString8(rc));
......@@ -953,9 +954,12 @@ static HRESULT test_primary(LPGUID lpGuid)
bufdesc.dwSize=sizeof(bufdesc);
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN;
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));
if (rc==DS_OK && primary!=NULL) {
ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer: "
"%s\n",DXGetErrorString8(rc));
if (rc==DSERR_CONTROLUNAVAIL)
trace(" No Primary\n");
else if (rc==DS_OK && primary!=NULL) {
test_buffer(dso,primary,1,TRUE,0,TRUE,0,winetest_interactive &&
!(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,NULL,0,0,
FALSE,0);
......
......@@ -556,11 +556,12 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
else
bufdesc.dwFlags|=(DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN);
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() "
"failed to create a %sprimary buffer: %s\n",has_3d?"3D ":"",
DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
ok((rc==DS_OK && primary!=NULL) || (rc == DSERR_CONTROLUNAVAIL),
"IDirectSound8_CreateSoundBuffer() failed to create a %sprimary buffer: "
"%s\n",has_3d?"3D ":"", DXGetErrorString8(rc));
if (rc == DSERR_CONTROLUNAVAIL)
trace(" No Primary\n");
else if (rc==DS_OK && primary!=NULL) {
rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
DXGetErrorString8(rc));
......@@ -847,9 +848,12 @@ static HRESULT test_primary8(LPGUID lpGuid)
bufdesc.dwSize=sizeof(bufdesc);
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME|DSBCAPS_CTRLPAN;
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,"IDirectSound8_CreateSoundBuffer() failed "
"to create a primary buffer: 0x%lx\n",rc);
if (rc==DS_OK && primary!=NULL) {
ok((rc==DS_OK && primary!=NULL) || (rc == DSERR_CONTROLUNAVAIL),
"IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: "
"%s\n",DXGetErrorString8(rc));
if (rc == DSERR_CONTROLUNAVAIL)
trace(" No Primary\n");
else if (rc==DS_OK && primary!=NULL) {
test_buffer8(dso,primary,1,TRUE,0,TRUE,0,winetest_interactive &&
!(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0,NULL,0,0);
if (winetest_interactive) {
......
......@@ -428,10 +428,12 @@ static HRESULT test_primary(LPGUID lpGuid)
bufdesc.dwSize=sizeof(bufdesc);
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME;
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer: "
"%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
if (rc==DSERR_CONTROLUNAVAIL)
trace(" No Primary\n");
else if (rc==DS_OK && primary!=NULL) {
LONG vol;
/* Try to create a second primary buffer */
......
......@@ -454,10 +454,12 @@ static HRESULT test_primary8(LPGUID lpGuid)
bufdesc.dwSize=sizeof(bufdesc);
bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_CTRLVOLUME;
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&primary,NULL);
ok(rc==DS_OK && primary!=NULL,
ok((rc==DS_OK && primary!=NULL) || (rc==DSERR_CONTROLUNAVAIL),
"IDirectSound8_CreateSoundBuffer() failed to create a primary buffer: "
"%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
if (rc==DSERR_CONTROLUNAVAIL)
trace(" No Primary\n");
else if (rc==DS_OK && primary!=NULL) {
LONG vol;
/* Try to create a second primary buffer */
......
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