Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fe1aebb6
Commit
fe1aebb6
authored
Feb 02, 2022
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Feb 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmsynth/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8cfe529a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
53 deletions
+52
-53
Makefile.in
dlls/dmsynth/tests/Makefile.in
+0
-1
dmsynth.c
dlls/dmsynth/tests/dmsynth.c
+52
-52
No files found.
dlls/dmsynth/tests/Makefile.in
View file @
fe1aebb6
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
dmsynth.dll
IMPORTS
=
oleaut32 ole32 uuid
...
...
dlls/dmsynth/tests/dmsynth.c
View file @
fe1aebb6
...
...
@@ -67,81 +67,81 @@ static void test_dmsynth(void)
DMUS_PORTCAPS
caps
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynth
,
(
LPVOID
*
)
&
dmsynth
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %
#l
x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynthSink
,
(
void
**
)
&
dmsynth_sink
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %
#l
x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynthSink
,
(
void
**
)
&
dmsynth_sink2
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned: %
#l
x
\n
"
,
hr
);
hr
=
IDirectMusicSynth_QueryInterface
(
dmsynth
,
&
IID_IKsControl
,
(
LPVOID
*
)
&
control_synth
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_QueryInterface returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_QueryInterface returned: %
#l
x
\n
"
,
hr
);
S
(
U
(
property
)).
Id
=
0
;
S
(
U
(
property
)).
Flags
=
KSPROPERTY_TYPE_GET
;
S
(
U
(
property
)).
Set
=
GUID_DMUS_PROP_INSTRUMENT2
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %u, should be 1
\n
"
,
value
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %
#l
x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %
l
u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %
l
u, should be 1
\n
"
,
value
);
S
(
U
(
property
)).
Set
=
GUID_DMUS_PROP_DLS2
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %u, should be 1
\n
"
,
value
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %
#l
x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %
l
u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %
l
u, should be 1
\n
"
,
value
);
S
(
U
(
property
)).
Set
=
GUID_DMUS_PROP_GM_Hardware
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %u, should be 0
\n
"
,
value
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %
#l
x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %
l
u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %
l
u, should be 0
\n
"
,
value
);
S
(
U
(
property
)).
Set
=
GUID_DMUS_PROP_GS_Hardware
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %u, should be 0
\n
"
,
value
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %
#l
x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %
l
u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %
l
u, should be 0
\n
"
,
value
);
S
(
U
(
property
)).
Set
=
GUID_DMUS_PROP_XG_Hardware
;
hr
=
IKsControl_KsProperty
(
control_synth
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %u, should be 0
\n
"
,
value
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %
#l
x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %
l
u, should be 4
\n
"
,
bytes
);
ok
(
value
==
FALSE
,
"Return value: %
l
u, should be 0
\n
"
,
value
);
hr
=
IDirectMusicSynthSink_QueryInterface
(
dmsynth_sink
,
&
IID_IKsControl
,
(
LPVOID
*
)
&
control_sink
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_QueryInterface returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_QueryInterface returned: %
#l
x
\n
"
,
hr
);
S
(
U
(
property
)).
Set
=
GUID_DMUS_PROP_SinkUsesDSound
;
hr
=
IKsControl_KsProperty
(
control_sink
,
&
property
,
sizeof
(
property
),
&
value
,
sizeof
(
value
),
&
bytes
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %u, should be 1
\n
"
,
value
);
ok
(
hr
==
S_OK
,
"IKsControl_KsProperty returned: %
#l
x
\n
"
,
hr
);
ok
(
bytes
==
sizeof
(
DWORD
),
"Returned bytes: %
l
u, should be 4
\n
"
,
bytes
);
ok
(
value
==
TRUE
,
"Return value: %
l
u, should be 1
\n
"
,
value
);
/* Synth isn't fully initialized yet */
hr
=
IDirectMusicSynth_Activate
(
dmsynth
,
TRUE
);
ok
(
hr
==
DMUS_E_NOSYNTHSINK
,
"IDirectMusicSynth_Activate returned: %x
\n
"
,
hr
);
ok
(
hr
==
DMUS_E_NOSYNTHSINK
,
"IDirectMusicSynth_Activate returned: %
#l
x
\n
"
,
hr
);
/* Synth has no default clock */
hr
=
IDirectMusicSynth_GetLatencyClock
(
dmsynth
,
&
clock_synth
);
ok
(
hr
==
DMUS_E_NOSYNTHSINK
,
"IDirectMusicSynth_GetLatencyClock returned: %x
\n
"
,
hr
);
ok
(
hr
==
DMUS_E_NOSYNTHSINK
,
"IDirectMusicSynth_GetLatencyClock returned: %
#l
x
\n
"
,
hr
);
/* SynthSink has a default clock */
hr
=
IDirectMusicSynthSink_GetLatencyClock
(
dmsynth_sink
,
&
clock_sink
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_GetLatencyClock returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_GetLatencyClock returned: %
#l
x
\n
"
,
hr
);
ok
(
clock_sink
!=
NULL
,
"No clock returned
\n
"
);
ref_clock_sink
=
get_refcount
(
clock_sink
);
/* This will Init() the SynthSink and finish initializing the Synth */
hr
=
IDirectMusicSynthSink_Init
(
dmsynth_sink2
,
NULL
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_Init returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynthSink_Init returned: %
#l
x
\n
"
,
hr
);
hr
=
IDirectMusicSynth_SetSynthSink
(
dmsynth
,
dmsynth_sink2
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_SetSynthSink returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_SetSynthSink returned: %
#l
x
\n
"
,
hr
);
hr
=
IDirectMusicSynth_SetSynthSink
(
dmsynth
,
dmsynth_sink
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_SetSynthSink returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_SetSynthSink returned: %
#l
x
\n
"
,
hr
);
/* Check clocks are the same */
hr
=
IDirectMusicSynth_GetLatencyClock
(
dmsynth
,
&
clock_synth
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_GetLatencyClock returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IDirectMusicSynth_GetLatencyClock returned: %
#l
x
\n
"
,
hr
);
ok
(
clock_synth
!=
NULL
,
"No clock returned
\n
"
);
ok
(
clock_synth
==
clock_sink
,
"Synth and SynthSink clocks are not the same
\n
"
);
ref_clock_synth
=
get_refcount
(
clock_synth
);
...
...
@@ -149,13 +149,13 @@ static void test_dmsynth(void)
/* GetPortCaps */
hr
=
IDirectMusicSynth_GetPortCaps
(
dmsynth
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetPortCaps failed: %#x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"GetPortCaps failed: %#
l
x
\n
"
,
hr
);
memset
(
&
caps
,
0
,
sizeof
(
caps
));
hr
=
IDirectMusicSynth_GetPortCaps
(
dmsynth
,
&
caps
);
ok
(
hr
==
E_INVALIDARG
,
"GetPortCaps failed: %#x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"GetPortCaps failed: %#
l
x
\n
"
,
hr
);
caps
.
dwSize
=
sizeof
(
caps
)
+
1
;
hr
=
IDirectMusicSynth_GetPortCaps
(
dmsynth
,
&
caps
);
ok
(
hr
==
S_OK
,
"GetPortCaps failed: %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetPortCaps failed: %#
l
x
\n
"
,
hr
);
if
(
control_synth
)
IDirectMusicSynth_Release
(
control_synth
);
...
...
@@ -184,38 +184,38 @@ static void test_COM(void)
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
(
IUnknown
*
)
0xdeadbeef
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
dms8
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"DirectMusicSynth create failed: %
08
x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
"DirectMusicSynth create failed: %
#l
x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
ok
(
!
dms8
,
"dms8 = %p
\n
"
,
dms8
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicObject
,
(
void
**
)
&
dms8
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicSynth create failed: %
08
x, expected E_NOINTERFACE
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicSynth create failed: %
#l
x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount for all DirectMusicSynth interfaces */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynth
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynth8
,
(
void
**
)
&
dms8
);
ok
(
hr
==
S_OK
,
"DirectMusicSynth create failed: %
08
x, expected S_OK
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"DirectMusicSynth create failed: %
#l
x, expected S_OK
\n
"
,
hr
);
refcount
=
IDirectMusicSynth8_AddRef
(
dms8
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
ok
(
refcount
==
2
,
"refcount == %
l
u, expected 2
\n
"
,
refcount
);
hr
=
IDirectMusicSynth8_QueryInterface
(
dms8
,
&
IID_IKsControl
,
(
void
**
)
&
iksc
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IKsControl failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IKsControl failed: %
#l
x
\n
"
,
hr
);
refcount
=
IKsControl_AddRef
(
iksc
);
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
ok
(
refcount
==
4
,
"refcount == %
l
u, expected 4
\n
"
,
refcount
);
IKsControl_Release
(
iksc
);
hr
=
IDirectMusicSynth8_QueryInterface
(
dms8
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %
#l
x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk
);
ok
(
refcount
==
5
,
"refcount == %u, expected 5
\n
"
,
refcount
);
ok
(
refcount
==
5
,
"refcount == %
l
u, expected 5
\n
"
,
refcount
);
IUnknown_Release
(
unk
);
/* Unsupported interfaces */
hr
=
IDirectMusicSynth8_QueryInterface
(
dms8
,
&
IID_IDirectMusicSynthSink
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IDirectMusicSynthSink failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IDirectMusicSynthSink failed: %
#l
x
\n
"
,
hr
);
hr
=
IDirectMusicSynth8_QueryInterface
(
dms8
,
&
IID_IReferenceClock
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IReferenceClock failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IReferenceClock failed: %
#l
x
\n
"
,
hr
);
while
(
IDirectMusicSynth8_Release
(
dms8
));
}
...
...
@@ -232,36 +232,36 @@ static void test_COM_synthsink(void)
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
(
IUnknown
*
)
0xdeadbeef
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
dmss
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"DirectMusicSynthSink create failed: %
08
x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
"DirectMusicSynthSink create failed: %
#l
x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
ok
(
!
dmss
,
"dmss = %p
\n
"
,
dmss
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicObject
,
(
void
**
)
&
dmss
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicSynthSink create failed: %
08
x, expected E_NOINTERFACE
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicSynthSink create failed: %
#l
x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount for all DirectMusicSynthSink interfaces */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSynthSink
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSynthSink
,
(
void
**
)
&
dmss
);
ok
(
hr
==
S_OK
,
"DirectMusicSynthSink create failed: %
08
x, expected S_OK
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"DirectMusicSynthSink create failed: %
#l
x, expected S_OK
\n
"
,
hr
);
refcount
=
IDirectMusicSynthSink_AddRef
(
dmss
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
ok
(
refcount
==
2
,
"refcount == %
l
u, expected 2
\n
"
,
refcount
);
hr
=
IDirectMusicSynthSink_QueryInterface
(
dmss
,
&
IID_IKsControl
,
(
void
**
)
&
iksc
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IKsControl failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IKsControl failed: %
#l
x
\n
"
,
hr
);
refcount
=
IKsControl_AddRef
(
iksc
);
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
ok
(
refcount
==
4
,
"refcount == %
l
u, expected 4
\n
"
,
refcount
);
IKsControl_Release
(
iksc
);
hr
=
IDirectMusicSynthSink_QueryInterface
(
dmss
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %
#l
x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk
);
ok
(
refcount
==
5
,
"refcount == %u, expected 5
\n
"
,
refcount
);
ok
(
refcount
==
5
,
"refcount == %
l
u, expected 5
\n
"
,
refcount
);
IUnknown_Release
(
unk
);
/* Unsupported interfaces */
hr
=
IDirectMusicSynthSink_QueryInterface
(
dmss
,
&
IID_IReferenceClock
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IReferenceClock failed: %
08
x
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"QueryInterface for IID_IReferenceClock failed: %
#l
x
\n
"
,
hr
);
while
(
IDirectMusicSynthSink_Release
(
dmss
));
}
...
...
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