Commit 4c3d6617 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Refactored common test code into subroutines.

Added tests for correct Compact behavior. Added tests for all possible IDirectSound[8] creation modes with good and bad arguments. Split dsound.c and ds3d.c into separate files for IDirectSound and IDirectSound8 interfaces and added code to not execute IDirectSound8 tests when run with a dsound.dll of version 7 or earlier. We should now be able to run these tests on a Windows system with DX7 or earlier (untested).
parent b6ab40e9
Makefile
capture.ok
ds3d.ok
ds3d8.ok
dsound.ok
dsound8.ok
propset.ok
testlist.c
......@@ -9,7 +9,9 @@ EXTRALIBS = -ldxguid -luuid -ldxerr8
CTESTS = \
capture.c \
ds3d.c \
ds3d8.c \
dsound.c \
dsound8.c \
propset.c
@MAKE_TEST_RULES@
......
......@@ -38,7 +38,6 @@
#include "dsound_test.h"
#define PI 3.14159265358979323846
char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size)
{
......@@ -526,7 +525,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
ok(rc==DS_OK,"DirectSoundCreate failed: 0x%lx\n",rc);
ok(rc==DS_OK,"DirectSoundCreate failed: 0x%08lx\n",rc);
if (rc!=DS_OK)
return rc;
......@@ -694,50 +693,6 @@ EXIT:
return rc;
}
static HRESULT test_dsound(LPGUID lpGuid)
{
HRESULT rc;
LPDIRECTSOUND dso=NULL;
DWORD speaker_config, new_speaker_config;
int ref;
/* The basic DirectSound tests are performed in the playback test */
/* Create the DirectSound object */
rc=DirectSoundCreate(lpGuid,&dso,NULL);
ok(rc==DS_OK,"DirectSoundCreate failed: 0x%lx\n",rc);
if (rc!=DS_OK)
return rc;
rc=IDirectSound_GetSpeakerConfig(dso,0);
ok(rc==DSERR_INVALIDPARAM,"GetSpeakerConfig should have failed: 0x%lx\n",rc);
rc=IDirectSound_GetSpeakerConfig(dso,&speaker_config);
ok(rc==DS_OK,"GetSpeakerConfig failed: 0x%lx\n",rc);
if (rc==DS_OK) {
trace(" DirectSound SpeakerConfig: 0x%08lx\n", speaker_config);
}
speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO,DSSPEAKER_GEOMETRY_WIDE);
rc=IDirectSound_SetSpeakerConfig(dso,speaker_config);
ok(rc==DS_OK,"SetSpeakerConfig failed: 0x%lx\n",rc);
if (rc==DS_OK) {
rc=IDirectSound_GetSpeakerConfig(dso,&new_speaker_config);
ok(rc==DS_OK,"GetSpeakerConfig failed: 0x%lx\n",rc);
if (rc==DS_OK)
ok(speaker_config==new_speaker_config,"SetSpeakerConfig failed to set speaker config: expected 0x%08lx, got 0x%08lx\n",
speaker_config,new_speaker_config);
}
/* Release the DirectSound object */
ref=IDirectSound_Release(dso);
ok(ref==0,"IDirectSound_Release has %d references, should have 0\n",ref);
if (ref!=0)
return DSERR_GENERIC;
return DS_OK;
}
static HRESULT test_primary(LPGUID lpGuid)
{
HRESULT rc;
......@@ -959,7 +914,6 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
LPCSTR lpcstrModule, LPVOID lpContext)
{
trace("*** Testing %s - %s\n",lpcstrDescription,lpcstrModule);
test_dsound(lpGuid);
trace(" Testing the primary buffer\n");
test_primary(lpGuid);
......
......@@ -57,3 +57,6 @@ extern void init_format(WAVEFORMATEX*,int,int,int,int);
extern void test_buffer(LPDIRECTSOUND,LPDIRECTSOUNDBUFFER,
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
LPDIRECTSOUND3DLISTENER,BOOL,BOOL);
extern void test_buffer8(LPDIRECTSOUND8,LPDIRECTSOUNDBUFFER,
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
LPDIRECTSOUND3DLISTENER,BOOL,BOOL);
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