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
997be9c4
Commit
997be9c4
authored
Mar 29, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Mar 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Add some tests for enumerating and creating ports.
parent
756f2964
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
0 deletions
+113
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/dmusic/tests/Makefile.in
+7
-0
dmusic.c
dlls/dmusic/tests/dmusic.c
+104
-0
No files found.
configure
View file @
997be9c4
...
...
@@ -15021,6 +15021,7 @@ wine_fn_config_dll dmscript enable_dmscript
wine_fn_config_dll dmstyle enable_dmstyle
wine_fn_config_dll dmsynth enable_dmsynth
wine_fn_config_dll dmusic enable_dmusic
wine_fn_config_test dlls/dmusic/tests dmusic_test
wine_fn_config_dll dmusic32 enable_dmusic32 implib
wine_fn_config_dll dnsapi enable_dnsapi implib
wine_fn_config_test dlls/dnsapi/tests dnsapi_test
...
...
configure.ac
View file @
997be9c4
...
...
@@ -2528,6 +2528,7 @@ WINE_CONFIG_DLL(dmscript)
WINE_CONFIG_DLL(dmstyle)
WINE_CONFIG_DLL(dmsynth)
WINE_CONFIG_DLL(dmusic)
WINE_CONFIG_TEST(dlls/dmusic/tests)
WINE_CONFIG_DLL(dmusic32,,[implib])
WINE_CONFIG_DLL(dnsapi,,[implib])
WINE_CONFIG_TEST(dlls/dnsapi/tests)
...
...
dlls/dmusic/tests/Makefile.in
0 → 100644
View file @
997be9c4
TESTDLL
=
dmusic.dll
IMPORTS
=
oleaut32 ole32 uuid
C_SRCS
=
\
dmusic.c
@MAKE_TEST_RULES@
dlls/dmusic/tests/dmusic.c
0 → 100644
View file @
997be9c4
/*
* Unit tests for dmusic functions
*
* Copyright (C) 2012 Christian Costa
*
* 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 COBJMACROS
#include <stdio.h>
#include "wine/test.h"
#include "uuids.h"
#include "ole2.h"
#include "initguid.h"
#include "dmusici.h"
static
inline
char
*
debugstr_guid
(
CONST
GUID
*
id
)
{
static
char
string
[
39
];
sprintf
(
string
,
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
,
id
->
Data1
,
id
->
Data2
,
id
->
Data3
,
id
->
Data4
[
0
],
id
->
Data4
[
1
],
id
->
Data4
[
2
],
id
->
Data4
[
3
],
id
->
Data4
[
4
],
id
->
Data4
[
5
],
id
->
Data4
[
6
],
id
->
Data4
[
7
]
);
return
string
;
}
static
void
test_dmusic
(
void
)
{
IDirectMusic
*
dmusic
=
NULL
;
HRESULT
hr
;
ULONG
index
=
0
;
DMUS_PORTCAPS
port_caps
;
DMUS_PORTPARAMS
port_params
;
IDirectMusicPort
*
port
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusic
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusic
,
(
LPVOID
*
)
&
dmusic
);
if
(
hr
!=
S_OK
)
{
skip
(
"Cannot create DirectMusic object (%x)
\n
"
,
hr
);
return
;
}
port_params
.
dwSize
=
sizeof
(
port_params
);
port_params
.
dwValidParams
=
DMUS_PORTPARAMS_CHANNELGROUPS
|
DMUS_PORTPARAMS_AUDIOCHANNELS
;
port_params
.
dwChannelGroups
=
1
;
port_params
.
dwAudioChannels
=
2
;
/* No port can be created before SetDirectSound is called */
hr
=
IDirectMusic_CreatePort
(
dmusic
,
&
GUID_NULL
,
&
port_params
,
&
port
,
NULL
);
todo_wine
ok
(
hr
==
DMUS_E_DSOUND_NOT_SET
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"IDirectMusic_SetDirectSound returned: %x
\n
"
,
hr
);
/* Test creation of default port with GUID_NULL */
hr
=
IDirectMusic_CreatePort
(
dmusic
,
&
GUID_NULL
,
&
port_params
,
&
port
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"IDirectMusic_CreatePort returned: %x
\n
"
,
hr
);
port_caps
.
dwSize
=
sizeof
(
port_caps
);
while
(
IDirectMusic_EnumPort
(
dmusic
,
index
,
&
port_caps
)
==
S_OK
)
{
ok
(
port_caps
.
dwSize
==
sizeof
(
port_caps
),
"DMUS_PORTCAPS dwSize member is wrong (%u)
\n
"
,
port_caps
.
dwSize
);
trace
(
"Port %u:
\n
"
,
index
);
trace
(
" dwFlags = %x
\n
"
,
port_caps
.
dwFlags
);
trace
(
" guidPort = %s
\n
"
,
debugstr_guid
(
&
port_caps
.
guidPort
));
trace
(
" dwClass = %u
\n
"
,
port_caps
.
dwClass
);
trace
(
" dwType = %u
\n
"
,
port_caps
.
dwType
);
trace
(
" dwMemorySize = %u
\n
"
,
port_caps
.
dwMemorySize
);
trace
(
" dwMaxChannelGroups = %u
\n
"
,
port_caps
.
dwMaxChannelGroups
);
trace
(
" dwMaxVoices = %u
\n
"
,
port_caps
.
dwMaxVoices
);
trace
(
" dwMaxAudioChannels = %u
\n
"
,
port_caps
.
dwMaxAudioChannels
);
trace
(
" dwEffectFlags = %x
\n
"
,
port_caps
.
dwEffectFlags
);
trace
(
" wszDescription = %s
\n
"
,
wine_dbgstr_w
(
port_caps
.
wszDescription
));
index
++
;
}
if
(
port
)
IDirectMusicPort_Release
(
port
);
if
(
dmusic
)
IDirectMusic_Release
(
dmusic
);
}
START_TEST
(
dmusic
)
{
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
test_dmusic
();
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