Make the dsound tests run with DirectX < 8.
This commit is contained in:
parent
e3fb36140a
commit
7c89759e88
@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
#define NOTIFICATIONS 5
|
#define NOTIFICATIONS 5
|
||||||
|
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
|
||||||
|
|
||||||
static const char * get_format_str(WORD format)
|
static const char * get_format_str(WORD format)
|
||||||
{
|
{
|
||||||
@ -307,7 +309,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
|||||||
|
|
||||||
/* Private dsound.dll: Error: Invalid interface buffer */
|
/* Private dsound.dll: Error: Invalid interface buffer */
|
||||||
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
|
trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
|
||||||
rc=DirectSoundCaptureCreate(lpGuid,NULL,NULL);
|
rc=pDirectSoundCaptureCreate(lpGuid,NULL,NULL);
|
||||||
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCaptureCreate() should have "
|
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCaptureCreate() should have "
|
||||||
"returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
|
"returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc==DS_OK) {
|
if (rc==DS_OK) {
|
||||||
@ -316,7 +318,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
|
|||||||
"have 0\n",ref);
|
"have 0\n",ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc=DirectSoundCaptureCreate(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)
|
||||||
@ -492,12 +494,27 @@ EXIT:
|
|||||||
static void capture_tests()
|
static void capture_tests()
|
||||||
{
|
{
|
||||||
HRESULT rc;
|
HRESULT rc;
|
||||||
rc=DirectSoundCaptureEnumerateA(&dscenum_callback,NULL);
|
rc=pDirectSoundCaptureEnumerateA(&dscenum_callback,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %s\n",
|
ok(rc==DS_OK,"DirectSoundCaptureEnumerateA() failed: %s\n",
|
||||||
DXGetErrorString8(rc));
|
DXGetErrorString8(rc));
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(capture)
|
START_TEST(capture)
|
||||||
{
|
{
|
||||||
|
HMODULE hDsound;
|
||||||
|
|
||||||
|
hDsound = LoadLibraryA("dsound.dll");
|
||||||
|
if (!hDsound) {
|
||||||
|
trace("dsound.dll not found\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate");
|
||||||
|
pDirectSoundCaptureEnumerateA=(void*)GetProcAddress(hDsound,"DirectSoundCaptureEnumerateA");
|
||||||
|
if (!pDirectSoundCaptureCreate || !pDirectSoundCaptureEnumerateA)
|
||||||
|
{
|
||||||
|
trace("capture test skipped\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
capture_tests();
|
capture_tests();
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
#include "dsound_test.h"
|
#include "dsound_test.h"
|
||||||
|
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char* wave;
|
char* wave;
|
||||||
DWORD wave_len;
|
DWORD wave_len;
|
||||||
@ -535,7 +537,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
|
|||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -788,7 +790,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
|
|||||||
int ref, i;
|
int ref, i;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -870,7 +872,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid)
|
|||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -943,7 +945,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
|
|||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -1077,7 +1079,6 @@ static void ds3d8_tests()
|
|||||||
START_TEST(ds3d8)
|
START_TEST(ds3d8)
|
||||||
{
|
{
|
||||||
HMODULE hDsound;
|
HMODULE hDsound;
|
||||||
FARPROC pFunc;
|
|
||||||
|
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
|
|
||||||
@ -1087,8 +1088,8 @@ START_TEST(ds3d8)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pFunc = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
|
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
|
||||||
if (!pFunc) {
|
if (!pDirectSoundCreate8) {
|
||||||
trace("ds3d8 test skipped\n");
|
trace("ds3d8 test skipped\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
|
|
||||||
#include "dsound_test.h"
|
#include "dsound_test.h"
|
||||||
|
|
||||||
|
static HRESULT (WINAPI *pDirectSoundCreate8)(LPCGUID,LPDIRECTSOUND8*,LPUNKNOWN)=NULL;
|
||||||
|
|
||||||
static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
|
static void IDirectSound8_test(LPDIRECTSOUND8 dso, BOOL initialized,
|
||||||
LPCGUID lpGuid)
|
LPCGUID lpGuid)
|
||||||
{
|
{
|
||||||
@ -217,25 +219,25 @@ static void IDirectSound8_tests()
|
|||||||
"should have failed: %s\n",DXGetErrorString8(rc));
|
"should have failed: %s\n",DXGetErrorString8(rc));
|
||||||
|
|
||||||
/* try with no device specified */
|
/* try with no device specified */
|
||||||
rc=DirectSoundCreate8(NULL,&dso,NULL);
|
rc=pDirectSoundCreate8(NULL,&dso,NULL);
|
||||||
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (dso)
|
if (dso)
|
||||||
IDirectSound8_test(dso, TRUE, NULL);
|
IDirectSound8_test(dso, TRUE, NULL);
|
||||||
|
|
||||||
/* try with default playback device specified */
|
/* try with default playback device specified */
|
||||||
rc=DirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
|
rc=pDirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
|
||||||
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (dso)
|
if (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=DirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
|
rc=pDirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
|
||||||
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==S_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (dso)
|
if (dso)
|
||||||
IDirectSound8_test(dso, TRUE, NULL);
|
IDirectSound8_test(dso, TRUE, NULL);
|
||||||
|
|
||||||
/* try with a bad device specified */
|
/* try with a bad device specified */
|
||||||
rc=DirectSoundCreate8(&DSDEVID_DefaultVoiceCapture,&dso,NULL);
|
rc=pDirectSoundCreate8(&DSDEVID_DefaultVoiceCapture,&dso,NULL);
|
||||||
ok(rc==DSERR_NODRIVER,"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
|
ok(rc==DSERR_NODRIVER,"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
|
||||||
"should have failed: %s\n",DXGetErrorString8(rc));
|
"should have failed: %s\n",DXGetErrorString8(rc));
|
||||||
}
|
}
|
||||||
@ -247,12 +249,12 @@ static HRESULT test_dsound8(LPGUID lpGuid)
|
|||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
/* DSOUND: Error: Invalid interface buffer */
|
/* DSOUND: Error: Invalid interface buffer */
|
||||||
rc=DirectSoundCreate8(lpGuid,0,NULL);
|
rc=pDirectSoundCreate8(lpGuid,0,NULL);
|
||||||
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned "
|
ok(rc==DSERR_INVALIDPARAM,"DirectSoundCreate8() should have returned "
|
||||||
"DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
|
"DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
|
||||||
|
|
||||||
/* Create the DirectSound8 object */
|
/* Create the DirectSound8 object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -269,13 +271,13 @@ static HRESULT test_dsound8(LPGUID lpGuid)
|
|||||||
IDirectSound8_test(dso, FALSE, lpGuid);
|
IDirectSound8_test(dso, FALSE, lpGuid);
|
||||||
|
|
||||||
/* Create a DirectSound8 object */
|
/* Create a DirectSound8 object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc==DS_OK) {
|
if (rc==DS_OK) {
|
||||||
LPDIRECTSOUND8 dso1=NULL;
|
LPDIRECTSOUND8 dso1=NULL;
|
||||||
|
|
||||||
/* Create a second DirectSound8 object */
|
/* Create a second DirectSound8 object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso1,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso1,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc==DS_OK) {
|
if (rc==DS_OK) {
|
||||||
/* Release the second DirectSound8 object */
|
/* Release the second DirectSound8 object */
|
||||||
@ -296,7 +298,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
|
|||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
/* Create a DirectSound8 object */
|
/* Create a DirectSound8 object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc==DS_OK) {
|
if (rc==DS_OK) {
|
||||||
LPDIRECTSOUNDBUFFER secondary;
|
LPDIRECTSOUNDBUFFER secondary;
|
||||||
@ -362,7 +364,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
|
|||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -503,7 +505,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
|
|||||||
int f,ref;
|
int f,ref;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -639,7 +641,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
|
|||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
/* Create the DirectSound object */
|
/* Create the DirectSound object */
|
||||||
rc=DirectSoundCreate8(lpGuid,&dso,NULL);
|
rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
|
||||||
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
ok(rc==DS_OK,"DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
|
||||||
if (rc!=DS_OK)
|
if (rc!=DS_OK)
|
||||||
return rc;
|
return rc;
|
||||||
@ -751,7 +753,6 @@ static void dsound8_tests()
|
|||||||
START_TEST(dsound8)
|
START_TEST(dsound8)
|
||||||
{
|
{
|
||||||
HMODULE hDsound;
|
HMODULE hDsound;
|
||||||
FARPROC pFunc;
|
|
||||||
|
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
|
|
||||||
@ -761,8 +762,8 @@ START_TEST(dsound8)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pFunc = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
|
pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
|
||||||
if (!pFunc) {
|
if (!pDirectSoundCreate8) {
|
||||||
trace("dsound8 test skipped\n");
|
trace("dsound8 test skipped\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user