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
c38de04e
Commit
c38de04e
authored
Dec 14, 2009
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Dec 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Add some initial tests.
parent
12c3a012
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
0 deletions
+157
-0
configure
configure
+9
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/mmdevapi/tests/Makefile.in
+13
-0
mmdevenum.c
dlls/mmdevapi/tests/mmdevenum.c
+134
-0
No files found.
configure
View file @
c38de04e
...
...
@@ -15417,6 +15417,14 @@ dlls/mmdevapi/Makefile: dlls/mmdevapi/Makefile.in dlls/Makedll.rules"
ac_config_files
=
"
$ac_config_files
dlls/mmdevapi/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/mmdevapi/tests/Makefile"
test
"x
$enable_tests
"
!=
xno
&&
ALL_TEST_DIRS
=
"
$ALL_TEST_DIRS
\\
mmdevapi/tests"
ALL_MAKEFILE_DEPENDS
=
"
$ALL_MAKEFILE_DEPENDS
dlls/mmdevapi/tests/Makefile: dlls/mmdevapi/tests/Makefile.in dlls/Maketest.rules"
ac_config_files
=
"
$ac_config_files
dlls/mmdevapi/tests/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/mmdevldr.vxd/Makefile"
test
"x
$enable_win16
"
!=
xno
&&
ALL_DLL_DIRS
=
"
$ALL_DLL_DIRS
\\
mmdevldr.vxd"
...
...
@@ -19049,6 +19057,7 @@ do
"dlls/mlang/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/mlang/Makefile" ;;
"dlls/mlang/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/mlang/tests/Makefile" ;;
"dlls/mmdevapi/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/mmdevapi/Makefile" ;;
"dlls/mmdevapi/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/mmdevapi/tests/Makefile" ;;
"dlls/mmdevldr.vxd/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/mmdevldr.vxd/Makefile" ;;
"dlls/mmsystem.dll16/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/mmsystem.dll16/Makefile" ;;
"dlls/monodebg.vxd/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/monodebg.vxd/Makefile" ;;
...
...
configure.ac
View file @
c38de04e
...
...
@@ -2312,6 +2312,7 @@ WINE_CONFIG_MAKEFILE([dlls/midimap/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DL
WINE_CONFIG_MAKEFILE([dlls/mlang/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/mlang/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/mmdevapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/mmdevapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/mmdevldr.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/mmsystem.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/monodebg.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
...
...
dlls/mmdevapi/tests/Makefile.in
0 → 100644
View file @
c38de04e
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
mmdevapi.dll
IMPORTS
=
ole32 version user32 kernel32
CTESTS
=
\
mmdevenum.c
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/mmdevapi/tests/mmdevenum.c
0 → 100644
View file @
c38de04e
/*
* Copyright 2009 Maarten Lankhorst
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/test.h"
#define CINTERFACE
#define COBJMACROS
#include "initguid.h"
#include "mmdeviceapi.h"
#include "dshow.h"
#include "dsound.h"
/* Some of the QueryInterface tests are really just to check if I got the IID's right :) */
/* IMMDeviceCollection appears to have no QueryInterface method and instead forwards to mme */
static
void
test_collection
(
IMMDeviceEnumerator
*
mme
,
IMMDeviceCollection
*
col
)
{
IMMDeviceCollection
*
col2
;
IMMDeviceEnumerator
*
mme2
;
IUnknown
*
unk
;
HRESULT
hr
;
ULONG
ref
;
UINT
numdev
;
IMMDevice
*
dev
;
ref
=
IUnknown_AddRef
(
col
);
IUnknown_Release
(
col
);
ok
(
ref
==
2
,
"Invalid reference count %u on collection
\n
"
,
ref
);
hr
=
IUnknown_QueryInterface
(
col
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Cannot query for IID_IUnknown: 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
((
LONG_PTR
)
col
==
(
LONG_PTR
)
unk
,
"Pointers are not identical %p/%p/%p
\n
"
,
col
,
unk
,
mme
);
IUnknown_Release
(
unk
);
}
hr
=
IUnknown_QueryInterface
(
col
,
&
IID_IMMDeviceCollection
,
(
void
**
)
&
col2
);
ok
(
hr
==
S_OK
,
"Cannot query for IID_IMMDeviceCollection: 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IUnknown_Release
(
col2
);
hr
=
IUnknown_QueryInterface
(
col
,
&
IID_IMMDeviceEnumerator
,
(
void
**
)
&
mme2
);
ok
(
hr
==
E_NOINTERFACE
,
"Query for IID_IMMDeviceEnumerator returned: 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IUnknown_Release
(
mme2
);
hr
=
IMMDeviceCollection_GetCount
(
col
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetCount returned 0x%08x
\n
"
,
hr
);
hr
=
IMMDeviceCollection_GetCount
(
col
,
&
numdev
);
ok
(
hr
==
S_OK
,
"GetCount returned 0x%08x
\n
"
,
hr
);
dev
=
(
void
*
)(
LONG_PTR
)
0x12345678
;
hr
=
IMMDeviceCollection_Item
(
col
,
numdev
,
&
dev
);
ok
(
hr
==
E_INVALIDARG
,
"Asking for too high device returned 0x%08x
\n
"
,
hr
);
ok
(
dev
==
NULL
,
"Returned non-null device
\n
"
);
if
(
!
numdev
)
return
;
hr
=
IMMDeviceCollection_Item
(
col
,
0
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Query with null pointer returned 0x%08x
\n
"
,
hr
);
hr
=
IMMDeviceCollection_Item
(
col
,
0
,
&
dev
);
ok
(
hr
==
S_OK
,
"Valid Item returned 0x%08x
\n
"
,
hr
);
ok
(
dev
!=
NULL
,
"Device is null!
\n
"
);
if
(
dev
)
IUnknown_Release
(
dev
);
}
START_TEST
(
mmdevenum
)
{
HRESULT
hr
;
IUnknown
*
unk
=
NULL
;
IMMDeviceEnumerator
*
mme
;
ULONG
ref
;
IMMDeviceCollection
*
col
;
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
hr
=
CoCreateInstance
(
&
CLSID_MMDeviceEnumerator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMMDeviceEnumerator
,
(
void
**
)
&
mme
);
if
(
FAILED
(
hr
))
{
skip
(
"mmdevapi not available: 0x%08x
\n
"
,
hr
);
return
;
}
/* Odd behavior.. bug? */
ref
=
IUnknown_AddRef
(
mme
);
ok
(
ref
==
3
,
"Invalid reference count after incrementing: %u
\n
"
,
ref
);
IUnknown_Release
(
mme
);
hr
=
IUnknown_QueryInterface
(
mme
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"returned 0x%08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
ok
(
(
LONG_PTR
)
mme
==
(
LONG_PTR
)
unk
,
"Pointers are unequal %p/%p
\n
"
,
unk
,
mme
);
IUnknown_Release
(
unk
);
col
=
(
void
*
)(
LONG_PTR
)
0x12345678
;
hr
=
IMMDeviceEnumerator_EnumAudioEndpoints
(
mme
,
0xffff
,
DEVICE_STATEMASK_ALL
,
&
col
);
ok
(
hr
==
E_INVALIDARG
,
"Setting invalid data flow returned 0x%08x
\n
"
,
hr
);
ok
(
col
==
NULL
,
"Collection pointer non-null on failure
\n
"
);
hr
=
IMMDeviceEnumerator_EnumAudioEndpoints
(
mme
,
eAll
,
DEVICE_STATEMASK_ALL
+
1
,
&
col
);
ok
(
hr
==
E_INVALIDARG
,
"Setting invalid mask returned 0x%08x
\n
"
,
hr
);
hr
=
IMMDeviceEnumerator_EnumAudioEndpoints
(
mme
,
eAll
,
DEVICE_STATEMASK_ALL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Invalid pointer returned: 0x%08x
\n
"
,
hr
);
hr
=
IMMDeviceEnumerator_EnumAudioEndpoints
(
mme
,
eAll
,
DEVICE_STATEMASK_ALL
,
&
col
);
ok
(
hr
==
S_OK
,
"Valid EnumAudioEndpoints returned 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
(
!!
col
,
"Returned null pointer
\n
"
);
if
(
col
)
test_collection
(
mme
,
col
);
}
IUnknown_Release
(
mme
);
}
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