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
965e2ebb
Commit
965e2ebb
authored
Jan 17, 2010
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Feb 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Add some basic property store tests.
parent
fccdb30d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
1 deletion
+104
-1
Makefile.in
dlls/mmdevapi/tests/Makefile.in
+2
-1
propstore.c
dlls/mmdevapi/tests/propstore.c
+102
-0
No files found.
dlls/mmdevapi/tests/Makefile.in
View file @
965e2ebb
...
...
@@ -7,7 +7,8 @@ IMPORTS = ole32 version user32 kernel32
CTESTS
=
\
dependency.c
\
mmdevenum.c
mmdevenum.c
\
propstore.c
@MAKE_TEST_RULES@
...
...
dlls/mmdevapi/tests/propstore.c
0 → 100644
View file @
965e2ebb
/*
* Copyright 2010 Maarten Lankhorst for Codeweavers
*
* 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
*/
#define NONAMELESSUNION
#include "wine/test.h"
#define CINTERFACE
#define COBJMACROS
#ifdef STANDALONE
#include "initguid.h"
#endif
#include "unknwn.h"
#include "uuids.h"
#include "mmdeviceapi.h"
static
void
test_propertystore
(
IPropertyStore
*
store
)
{
HRESULT
hr
;
PROPVARIANT
pv
=
{
0
};
char
temp
[
40
];
hr
=
IPropertyStore_GetValue
(
store
,
&
PKEY_AudioEndpoint_GUID
,
&
pv
);
ok
(
hr
==
S_OK
,
"Failed with %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
pv
.
u
.
pwszVal
,
-
1
,
temp
,
sizeof
(
temp
)
-
1
,
NULL
,
NULL
);
temp
[
sizeof
(
temp
)
-
1
]
=
0
;
trace
(
"guid: %s
\n
"
,
temp
);
CoTaskMemFree
(
pv
.
u
.
pwszVal
);
}
}
START_TEST
(
propstore
)
{
HRESULT
hr
;
IMMDeviceEnumerator
*
mme
=
NULL
;
IMMDevice
*
dev
=
NULL
;
IPropertyStore
*
store
;
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
);
goto
cleanup
;
}
hr
=
IMMDeviceEnumerator_GetDefaultAudioEndpoint
(
mme
,
eRender
,
eMultimedia
,
&
dev
);
ok
(
hr
==
S_OK
||
hr
==
E_NOTFOUND
,
"GetDefaultAudioEndpoint failed: 0x%08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
if
(
hr
==
E_NOTFOUND
)
skip
(
"No sound card available
\n
"
);
else
skip
(
"GetDefaultAudioEndpoint returns 0x%08x
\n
"
,
hr
);
goto
cleanup
;
}
store
=
NULL
;
hr
=
IMMDevice_OpenPropertyStore
(
dev
,
3
,
&
store
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Wrong hr returned: %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
/* It seems on windows returning with E_INVALIDARG doesn't
* set store to NULL, so just don't set store to non-null
* before calling this function
*/
ok
(
!
store
,
"Store set to non-NULL on failure: %p/%08x
\n
"
,
store
,
hr
);
else
if
(
store
)
IPropertyStore_Release
(
store
);
hr
=
IMMDevice_OpenPropertyStore
(
dev
,
STGM_READ
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"Wrong hr returned: %08x
\n
"
,
hr
);
store
=
NULL
;
hr
=
IMMDevice_OpenPropertyStore
(
dev
,
STGM_READ
,
&
store
);
todo_wine
ok
(
hr
==
S_OK
,
"Opening valid store returned %08x
\n
"
,
hr
);
if
(
store
)
{
test_propertystore
(
store
);
IPropertyStore_Release
(
store
);
}
IMMDevice_Release
(
dev
);
cleanup
:
if
(
mme
)
IUnknown_Release
(
mme
);
CoUninitialize
();
}
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