Commit 3dcbaaa4 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Don't consider failure with DSERR_NODRIVER a test failure.

parent b1267aec
...@@ -321,8 +321,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -321,8 +321,11 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
rc=pDirectSoundCaptureCreate(lpGuid,&dsco,NULL); rc=pDirectSoundCaptureCreate(lpGuid,&dsco,NULL);
ok((rc==DS_OK)||(rc==DSERR_NODRIVER),"DirectSoundCaptureCreate() failed: " ok((rc==DS_OK)||(rc==DSERR_NODRIVER),"DirectSoundCaptureCreate() failed: "
"%s\n",DXGetErrorString8(rc)); "%s\n",DXGetErrorString8(rc));
if (rc!=DS_OK) if (rc!=DS_OK) {
if (rc==DSERR_NODRIVER)
trace(" No Driver\n");
goto EXIT; goto EXIT;
}
/* Private dsound.dll: Error: Invalid caps buffer */ /* Private dsound.dll: Error: Invalid caps buffer */
rc=IDirectSoundCapture_GetCaps(dsco,NULL); rc=IDirectSoundCapture_GetCaps(dsco,NULL);
......
...@@ -867,6 +867,27 @@ EXIT: ...@@ -867,6 +867,27 @@ EXIT:
return rc; return rc;
} }
static HRESULT test_for_driver(LPGUID lpGuid)
{
HRESULT rc;
LPDIRECTSOUND dso=NULL;
int ref;
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
ref=IDirectSound_Release(dso);
ok(ref==0,"IDirectSound_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
return rc;
}
static HRESULT test_primary(LPGUID lpGuid) static HRESULT test_primary(LPGUID lpGuid)
{ {
HRESULT rc; HRESULT rc;
...@@ -1128,8 +1149,15 @@ return DSERR_GENERIC; ...@@ -1128,8 +1149,15 @@ return DSERR_GENERIC;
static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
LPCSTR lpcstrModule, LPVOID lpContext) LPCSTR lpcstrModule, LPVOID lpContext)
{ {
HRESULT rc;
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
rc = test_for_driver(lpGuid);
if (rc == DSERR_NODRIVER) {
trace(" No Driver\n");
return 1;
}
trace(" Testing the primary buffer\n"); trace(" Testing the primary buffer\n");
test_primary(lpGuid); test_primary(lpGuid);
......
...@@ -781,6 +781,27 @@ EXIT: ...@@ -781,6 +781,27 @@ EXIT:
return rc; return rc;
} }
static HRESULT test_for_driver8(LPGUID lpGuid)
{
HRESULT rc;
LPDIRECTSOUND8 dso=NULL;
int ref;
/* Create the DirectSound object */
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
return rc;
ref=IDirectSound8_Release(dso);
ok(ref==0,"IDirectSound8_Release() has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
return rc;
}
static HRESULT test_primary8(LPGUID lpGuid) static HRESULT test_primary8(LPGUID lpGuid)
{ {
HRESULT rc; HRESULT rc;
...@@ -1043,8 +1064,15 @@ return DSERR_GENERIC; ...@@ -1043,8 +1064,15 @@ return DSERR_GENERIC;
static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
LPCSTR lpcstrModule, LPVOID lpContext) LPCSTR lpcstrModule, LPVOID lpContext)
{ {
HRESULT rc;
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
rc = test_for_driver8(lpGuid);
if (rc == DSERR_NODRIVER) {
trace(" No Driver\n");
return 1;
}
trace(" Testing the primary buffer\n"); trace(" Testing the primary buffer\n");
test_primary8(lpGuid); test_primary8(lpGuid);
......
...@@ -210,22 +210,24 @@ static void IDirectSound_tests() ...@@ -210,22 +210,24 @@ static void IDirectSound_tests()
/* try with no device specified */ /* try with no device specified */
rc=DirectSoundCreate(NULL,&dso,NULL); rc=DirectSoundCreate(NULL,&dso,NULL);
ok(rc==S_OK,"DirectSoundCreate(NULL) failed: %s\n",DXGetErrorString8(rc)); ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate(NULL) failed: %s\n",
if (dso) DXGetErrorString8(rc));
if (rc==S_OK && dso)
IDirectSound_test(dso, TRUE, NULL); IDirectSound_test(dso, TRUE, NULL);
/* try with default playback device specified */ /* try with default playback device specified */
rc=DirectSoundCreate(&DSDEVID_DefaultPlayback,&dso,NULL); rc=DirectSoundCreate(&DSDEVID_DefaultPlayback,&dso,NULL);
ok(rc==S_OK,"DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %s\n", ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate(DSDEVID_DefaultPlayback)"
DXGetErrorString8(rc)); " failed: %s\n", DXGetErrorString8(rc));
if (dso) if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL); IDirectSound_test(dso, TRUE, NULL);
/* try with default voice playback device specified */ /* try with default voice playback device specified */
rc=DirectSoundCreate(&DSDEVID_DefaultVoicePlayback,&dso,NULL); rc=DirectSoundCreate(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
ok(rc==S_OK,"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %s\n", ok(rc==S_OK||rc==DSERR_NODRIVER,
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %s\n",
DXGetErrorString8(rc)); DXGetErrorString8(rc));
if (dso) if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL); IDirectSound_test(dso, TRUE, NULL);
/* try with a bad device specified */ /* try with a bad device specified */
...@@ -719,11 +721,16 @@ EXIT: ...@@ -719,11 +721,16 @@ EXIT:
static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
LPCSTR lpcstrModule, LPVOID lpContext) LPCSTR lpcstrModule, LPVOID lpContext)
{ {
HRESULT rc;
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
test_dsound(lpGuid); rc = test_dsound(lpGuid);
test_primary(lpGuid); if (rc == DSERR_NODRIVER)
test_primary_secondary(lpGuid); trace(" No Driver\n");
test_secondary(lpGuid); else {
test_primary(lpGuid);
test_primary_secondary(lpGuid);
test_secondary(lpGuid);
}
return 1; return 1;
} }
......
...@@ -222,20 +222,23 @@ static void IDirectSound8_tests() ...@@ -222,20 +222,23 @@ static void IDirectSound8_tests()
/* try with no device specified */ /* try with no device specified */
rc=pDirectSoundCreate8(NULL,&dso,NULL); rc=pDirectSoundCreate8(NULL,&dso,NULL);
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc)); ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
if (dso) DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL); IDirectSound8_test(dso, TRUE, NULL);
/* try with default playback device specified */ /* try with default playback device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL); rc=pDirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc)); ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
if (dso) DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL); IDirectSound8_test(dso, TRUE, NULL);
/* try with default voice playback device specified */ /* try with default voice playback device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL); rc=pDirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc)); ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
if (dso) DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL); IDirectSound8_test(dso, TRUE, NULL);
/* try with a bad device specified */ /* try with a bad device specified */
...@@ -740,11 +743,16 @@ EXIT: ...@@ -740,11 +743,16 @@ EXIT:
static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
LPCSTR lpcstrModule, LPVOID lpContext) LPCSTR lpcstrModule, LPVOID lpContext)
{ {
HRESULT rc;
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule); trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
test_dsound8(lpGuid); rc = test_dsound8(lpGuid);
test_primary8(lpGuid); if (rc == DSERR_NODRIVER)
test_primary_secondary8(lpGuid); trace(" No Driver\n");
test_secondary8(lpGuid); else {
test_primary8(lpGuid);
test_primary_secondary8(lpGuid);
test_secondary8(lpGuid);
}
return 1; return 1;
} }
......
...@@ -270,8 +270,11 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -270,8 +270,11 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
rc=DirectSoundCreate(lpGuid,&dso,NULL); rc=DirectSoundCreate(lpGuid,&dso,NULL);
ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n", ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
DXGetErrorString8(rc)); DXGetErrorString8(rc));
if (rc!=DS_OK) if (rc!=DS_OK) {
if (rc==DSERR_NODRIVER)
trace(" No Driver\n");
goto EXIT; goto EXIT;
}
/* We must call SetCooperativeLevel before calling CreateSoundBuffer */ /* We must call SetCooperativeLevel before calling CreateSoundBuffer */
/* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */
......
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