Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
b5d2f84f
Commit
b5d2f84f
authored
21 years ago
by
Robert Reif
Committed by
Alexandre Julliard
21 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added some COM and property set tests.
Added LIBUUID to makefile.
parent
f5080c86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/dsound/tests/Makefile.in
+3
-1
3 additions, 1 deletion
dlls/dsound/tests/Makefile.in
dlls/dsound/tests/dsound.c
+0
-2
0 additions, 2 deletions
dlls/dsound/tests/dsound.c
dlls/dsound/tests/propset.c
+168
-0
168 additions, 0 deletions
dlls/dsound/tests/propset.c
with
171 additions
and
3 deletions
dlls/dsound/tests/Makefile.in
+
3
−
1
View file @
b5d2f84f
...
...
@@ -4,9 +4,11 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
TESTDLL
=
dsound.dll
IMPORTS
=
dsound user32 kernel32
EXTRALIBS
=
$(
LIBUUID
)
CTESTS
=
\
dsound.c
dsound.c
\
propset.c
@MAKE_TEST_RULES@
...
...
This diff is collapsed.
Click to expand it.
dlls/dsound/tests/dsound.c
+
0
−
2
View file @
b5d2f84f
...
...
@@ -26,8 +26,6 @@
#include
<stdlib.h>
#include
"wine/test.h"
#include
"objbase.h"
#include
"initguid.h"
#include
"dsound.h"
#ifndef DSBCAPS_CTRLDEFAULT
...
...
This diff is collapsed.
Click to expand it.
dlls/dsound/tests/propset.c
0 → 100644
+
168
−
0
View file @
b5d2f84f
/*
* Unit tests for CLSID_DirectSoundPrivate property set functions (used by dxdiag)
*
* Copyright (c) 2003 Robert Reif
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include
<windows.h>
#include
<math.h>
#include
<stdlib.h>
#include
"wine/test.h"
#include
"dsound.h"
#include
"dsconf.h"
typedef
HRESULT
(
CALLBACK
*
MYPROC
)(
REFCLSID
,
REFIID
,
LPVOID
FAR
*
);
BOOL
CALLBACK
callback
(
PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA
data
,
LPVOID
context
)
{
return
TRUE
;
}
static
void
propset_tests
()
{
HMODULE
hDsound
;
HRESULT
hr
;
IClassFactory
*
pcf
;
IKsPropertySet
*
pps
;
MYPROC
fProc
;
ULONG
support
;
hDsound
=
LoadLibrary
(
"dsound.dll"
);
ok
(
hDsound
!=
0
,
"LoadLibrary(dsound.dll) failed
\n
"
);
if
(
hDsound
==
0
)
return
;
fProc
=
(
MYPROC
)
GetProcAddress
(
hDsound
,
"DllGetClassObject"
);
/* try direct sound first */
hr
=
(
fProc
)(
&
CLSID_DirectSound
,
&
IID_IClassFactory
,
(
void
**
)
0
);
ok
(
hr
==
DSERR_INVALIDPARAM
,
"DllGetClassObject(CLSID_DirectSound, IID_IClassFactory) should have failed: 0x%lx
\n
"
,
hr
);
hr
=
(
fProc
)(
&
CLSID_DirectSound
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSound, IID_IClassFactory) failed: 0x%lx
\n
"
,
hr
);
if
(
pcf
==
0
)
goto
error
;
/* direct sound doesn't have an IKsPropertySet */
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)
0
);
ok
(
hr
==
DSERR_INVALIDPARAM
,
"CreateInstance(IID_IKsPropertySet) should have failed: 0x%lx
\n
"
,
hr
);
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
hr
==
E_NOINTERFACE
,
"CreateInstance(IID_IKsPropertySet) should have failed: 0x%lx
\n
"
,
hr
);
/* and the direct sound 8 version */
hr
=
(
fProc
)(
&
CLSID_DirectSound8
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSound8, IID_IClassFactory) failed: 0x%lx
\n
"
,
hr
);
if
(
pcf
==
0
)
goto
error
;
/* direct sound 8 doesn't have an IKsPropertySet */
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
hr
==
E_NOINTERFACE
,
"CreateInstance(IID_IKsPropertySet) should have failed: 0x%lx
\n
"
,
hr
);
/* try direct sound capture next */
hr
=
(
fProc
)(
&
CLSID_DirectSoundCapture
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) failed: 0x%lx
\n
"
,
hr
);
if
(
pcf
==
0
)
goto
error
;
/* direct sound capture doesn't have an IKsPropertySet */
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
hr
==
E_NOINTERFACE
,
"CreateInstance(IID_IKsPropertySet) should have failed: 0x%lx
\n
"
,
hr
);
/* and the direct sound capture 8 version */
hr
=
(
fProc
)(
&
CLSID_DirectSoundCapture8
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundCapture8, IID_IClassFactory) failed: 0x%lx
\n
"
,
hr
);
if
(
pcf
==
0
)
goto
error
;
/* direct sound capture 8 doesn't have an IKsPropertySet */
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
hr
==
E_NOINTERFACE
,
"CreateInstance(IID_IKsPropertySet) should have failed: 0x%lx
\n
"
,
hr
);
/* try direct sound full duplex next */
hr
=
(
fProc
)(
&
CLSID_DirectSoundFullDuplex
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundFullDuplex, IID_IClassFactory) failed: 0x%lx
\n
"
,
hr
);
if
(
pcf
==
0
)
goto
error
;
/* direct sound full duplex doesn't have an IKsPropertySet */
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
hr
==
E_NOINTERFACE
,
"CreateInstance(IID_IKsPropertySet) should have failed: 0x%lx
\n
"
,
hr
);
/* try direct sound private last */
hr
=
(
fProc
)(
&
CLSID_DirectSoundPrivate
,
&
IID_IClassFactory
,
(
void
**
)(
&
pcf
));
ok
(
pcf
!=
0
,
"DllGetClassObject(CLSID_DirectSoundPrivate, IID_IClassFactory) failed: 0x%lx
\n
"
,
hr
);
if
(
pcf
==
0
)
goto
error
;
/* direct sound private does have an IKsPropertySet */
hr
=
pcf
->
lpVtbl
->
CreateInstance
(
pcf
,
NULL
,
&
IID_IKsPropertySet
,
(
void
**
)(
&
pps
));
ok
(
hr
==
DS_OK
,
"CreateInstance(IID_IKsPropertySet) failed: 0x%lx
\n
"
,
hr
);
goto
error
;
hr
=
pps
->
lpVtbl
->
QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION
,
&
support
);
ok
(
hr
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION) failed: 0x%lx
\n
"
,
hr
);
goto
error
;
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: support = 0x%lx
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION: support = 0x%lx
\n
"
,
support
);
hr
=
pps
->
lpVtbl
->
QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING
,
&
support
);
ok
(
hr
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: 0x%lx
\n
"
,
hr
);
goto
error
;
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: support = 0x%lx
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING: support = 0x%lx
\n
"
,
support
);
hr
=
pps
->
lpVtbl
->
QuerySupport
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE
,
&
support
);
ok
(
hr
==
DS_OK
,
"QuerySupport(DSPROPSETID_DirectSoundDevice, DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE) failed: 0x%lx
\n
"
,
hr
);
goto
error
;
ok
(
support
&
KSPROPERTY_SUPPORT_GET
,
"Couldn't get DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%lx
\n
"
,
support
);
ok
(
!
(
support
&
KSPROPERTY_SUPPORT_SET
),
"Shouldn't be able to set DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE: support = 0x%lx
\n
"
,
support
);
if
(
support
&
KSPROPERTY_SUPPORT_GET
)
{
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA
data
;
ULONG
bytes
;
data
.
Callback
=
callback
;
data
.
Context
=
0
;
hr
=
pps
->
lpVtbl
->
Get
(
pps
,
&
DSPROPSETID_DirectSoundDevice
,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE
,
NULL
,
0
,
&
data
,
sizeof
(
data
),
&
bytes
);
ok
(
hr
==
DS_OK
,
"Couldn't enumerate: 0x%lx
\n
"
,
hr
);
}
error:
FreeLibrary
(
hDsound
);
}
START_TEST
(
propset
)
{
propset_tests
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment