Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7c89759e
Commit
7c89759e
authored
Sep 08, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the dsound tests run with DirectX < 8.
parent
e3fb3614
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
26 deletions
+45
-26
capture.c
dlls/dsound/tests/capture.c
+20
-3
ds3d8.c
dlls/dsound/tests/ds3d8.c
+8
-7
dsound8.c
dlls/dsound/tests/dsound8.c
+17
-16
No files found.
dlls/dsound/tests/capture.c
View file @
7c89759e
...
...
@@ -38,6 +38,8 @@
#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
)
{
...
...
@@ -307,7 +309,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
/* Private dsound.dll: Error: Invalid interface buffer */
trace
(
"*** Testing %s - %s ***
\n
"
,
lpcstrDescription
,
lpcstrModule
);
rc
=
DirectSoundCaptureCreate
(
lpGuid
,
NULL
,
NULL
);
rc
=
p
DirectSoundCaptureCreate
(
lpGuid
,
NULL
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"DirectSoundCaptureCreate() should have "
"returned DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
{
...
...
@@ -316,7 +318,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
"have 0
\n
"
,
ref
);
}
rc
=
DirectSoundCaptureCreate
(
lpGuid
,
&
dsco
,
NULL
);
rc
=
p
DirectSoundCaptureCreate
(
lpGuid
,
&
dsco
,
NULL
);
ok
((
rc
==
DS_OK
)
||
(
rc
==
DSERR_NODRIVER
),
"DirectSoundCaptureCreate() failed: "
"%s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
...
...
@@ -492,12 +494,27 @@ EXIT:
static
void
capture_tests
()
{
HRESULT
rc
;
rc
=
DirectSoundCaptureEnumerateA
(
&
dscenum_callback
,
NULL
);
rc
=
p
DirectSoundCaptureEnumerateA
(
&
dscenum_callback
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCaptureEnumerateA() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
}
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
();
}
dlls/dsound/tests/ds3d8.c
View file @
7c89759e
...
...
@@ -38,6 +38,8 @@
#include "dsound_test.h"
static
HRESULT
(
WINAPI
*
pDirectSoundCreate8
)(
LPCGUID
,
LPDIRECTSOUND8
*
,
LPUNKNOWN
)
=
NULL
;
typedef
struct
{
char
*
wave
;
DWORD
wave_len
;
...
...
@@ -535,7 +537,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
int
ref
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -788,7 +790,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
int
ref
,
i
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -870,7 +872,7 @@ static HRESULT test_primary_3d8(LPGUID lpGuid)
int
ref
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -943,7 +945,7 @@ static HRESULT test_primary_3d_with_listener8(LPGUID lpGuid)
int
ref
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -1077,7 +1079,6 @@ static void ds3d8_tests()
START_TEST
(
ds3d8
)
{
HMODULE
hDsound
;
FARPROC
pFunc
;
CoInitialize
(
NULL
);
...
...
@@ -1087,8 +1088,8 @@ START_TEST(ds3d8)
return
;
}
p
Func
=
(
void
*
)
GetProcAddress
(
hDsound
,
"DirectSoundCreate8"
);
if
(
!
p
Func
)
{
p
DirectSoundCreate8
=
(
void
*
)
GetProcAddress
(
hDsound
,
"DirectSoundCreate8"
);
if
(
!
p
DirectSoundCreate8
)
{
trace
(
"ds3d8 test skipped
\n
"
);
return
;
}
...
...
dlls/dsound/tests/dsound8.c
View file @
7c89759e
...
...
@@ -41,6 +41,8 @@
#include "dsound_test.h"
static
HRESULT
(
WINAPI
*
pDirectSoundCreate8
)(
LPCGUID
,
LPDIRECTSOUND8
*
,
LPUNKNOWN
)
=
NULL
;
static
void
IDirectSound8_test
(
LPDIRECTSOUND8
dso
,
BOOL
initialized
,
LPCGUID
lpGuid
)
{
...
...
@@ -217,25 +219,25 @@ static void IDirectSound8_tests()
"should have failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
/* try with no device specified */
rc
=
DirectSoundCreate8
(
NULL
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
NULL
,
&
dso
,
NULL
);
ok
(
rc
==
S_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
dso
)
IDirectSound8_test
(
dso
,
TRUE
,
NULL
);
/* try with default playback device specified */
rc
=
DirectSoundCreate8
(
&
DSDEVID_DefaultPlayback
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
&
DSDEVID_DefaultPlayback
,
&
dso
,
NULL
);
ok
(
rc
==
S_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
dso
)
IDirectSound8_test
(
dso
,
TRUE
,
NULL
);
/* try with default voice playback device specified */
rc
=
DirectSoundCreate8
(
&
DSDEVID_DefaultVoicePlayback
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
&
DSDEVID_DefaultVoicePlayback
,
&
dso
,
NULL
);
ok
(
rc
==
S_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
dso
)
IDirectSound8_test
(
dso
,
TRUE
,
NULL
);
/* try with a bad device specified */
rc
=
DirectSoundCreate8
(
&
DSDEVID_DefaultVoiceCapture
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
&
DSDEVID_DefaultVoiceCapture
,
&
dso
,
NULL
);
ok
(
rc
==
DSERR_NODRIVER
,
"DirectSoundCreate8(DSDEVID_DefaultVoiceCapture) "
"should have failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
}
...
...
@@ -247,12 +249,12 @@ static HRESULT test_dsound8(LPGUID lpGuid)
int
ref
;
/* DSOUND: Error: Invalid interface buffer */
rc
=
DirectSoundCreate8
(
lpGuid
,
0
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
0
,
NULL
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"DirectSoundCreate8() should have returned "
"DSERR_INVALIDPARAM, returned: %s
\n
"
,
DXGetErrorString8
(
rc
));
/* Create the DirectSound8 object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -269,13 +271,13 @@ static HRESULT test_dsound8(LPGUID lpGuid)
IDirectSound8_test
(
dso
,
FALSE
,
lpGuid
);
/* Create a DirectSound8 object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate
8
() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
{
LPDIRECTSOUND8
dso1
=
NULL
;
/* Create a second DirectSound8 object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso1
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso1
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
{
/* Release the second DirectSound8 object */
...
...
@@ -296,7 +298,7 @@ static HRESULT test_dsound8(LPGUID lpGuid)
return
rc
;
/* Create a DirectSound8 object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
==
DS_OK
)
{
LPDIRECTSOUNDBUFFER
secondary
;
...
...
@@ -362,7 +364,7 @@ static HRESULT test_primary8(LPGUID lpGuid)
int
ref
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -503,7 +505,7 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
int
f
,
ref
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -639,7 +641,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
int
ref
;
/* Create the DirectSound object */
rc
=
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
rc
=
p
DirectSoundCreate8
(
lpGuid
,
&
dso
,
NULL
);
ok
(
rc
==
DS_OK
,
"DirectSoundCreate8() failed: %s
\n
"
,
DXGetErrorString8
(
rc
));
if
(
rc
!=
DS_OK
)
return
rc
;
...
...
@@ -751,7 +753,6 @@ static void dsound8_tests()
START_TEST
(
dsound8
)
{
HMODULE
hDsound
;
FARPROC
pFunc
;
CoInitialize
(
NULL
);
...
...
@@ -761,8 +762,8 @@ START_TEST(dsound8)
return
;
}
p
Func
=
(
void
*
)
GetProcAddress
(
hDsound
,
"DirectSoundCreate8"
);
if
(
!
p
Func
)
{
p
DirectSoundCreate8
=
(
void
*
)
GetProcAddress
(
hDsound
,
"DirectSoundCreate8"
);
if
(
!
p
DirectSoundCreate8
)
{
trace
(
"dsound8 test skipped
\n
"
);
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment