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
5efaae40
Commit
5efaae40
authored
Sep 05, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime/tests: Test performance IDirectMusicTool interface.
parent
881e4246
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
dmime.c
dlls/dmime/tests/dmime.c
+74
-0
No files found.
dlls/dmime/tests/dmime.c
View file @
5efaae40
...
@@ -27,6 +27,34 @@
...
@@ -27,6 +27,34 @@
#include <audioclient.h>
#include <audioclient.h>
#include <guiddef.h>
#include <guiddef.h>
static
ULONG
get_refcount
(
void
*
iface
)
{
IUnknown
*
unknown
=
iface
;
IUnknown_AddRef
(
unknown
);
return
IUnknown_Release
(
unknown
);
}
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static
void
check_interface_
(
unsigned
int
line
,
void
*
iface_ptr
,
REFIID
iid
,
BOOL
supported
)
{
ULONG
expect_ref
=
get_refcount
(
iface_ptr
);
IUnknown
*
iface
=
iface_ptr
;
HRESULT
hr
,
expected
;
IUnknown
*
unk
;
expected
=
supported
?
S_OK
:
E_NOINTERFACE
;
hr
=
IUnknown_QueryInterface
(
iface
,
iid
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
expected
,
"got hr %#lx, expected %#lx.
\n
"
,
hr
,
expected
);
if
(
SUCCEEDED
(
hr
))
{
LONG
ref
=
get_refcount
(
unk
);
ok_
(
__FILE__
,
line
)(
ref
==
expect_ref
+
1
,
"got %ld
\n
"
,
ref
);
IUnknown_Release
(
unk
);
ref
=
get_refcount
(
iface_ptr
);
ok_
(
__FILE__
,
line
)(
ref
==
expect_ref
,
"got %ld
\n
"
,
ref
);
}
}
struct
test_tool
struct
test_tool
{
{
IDirectMusicTool
IDirectMusicTool_iface
;
IDirectMusicTool
IDirectMusicTool_iface
;
...
@@ -1405,6 +1433,51 @@ static void test_parsedescriptor(void)
...
@@ -1405,6 +1433,51 @@ static void test_parsedescriptor(void)
}
}
}
}
static
void
test_performance_tool
(
void
)
{
IDirectMusicPerformance
*
performance
;
IDirectMusicGraph
*
graph
;
IDirectMusicTool
*
tool
;
DWORD
value
,
types
[
1
];
DMUS_PMSG
msg
=
{
0
};
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicPerformance
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicPerformance
,
(
void
**
)
&
performance
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
check_interface
(
performance
,
&
IID_IDirectMusicTool8
,
FALSE
);
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicTool
,
(
void
**
)
&
tool
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
skip_tool
;
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicTool_Init
(
tool
,
graph
);
ok
(
hr
==
E_NOTIMPL
,
"got %#lx
\n
"
,
hr
);
value
=
0xdeadbeef
;
hr
=
IDirectMusicTool_GetMsgDeliveryType
(
tool
,
&
value
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
value
==
DMUS_PMSGF_TOOL_IMMEDIATE
,
"got %#lx
\n
"
,
value
);
value
=
0xdeadbeef
;
hr
=
IDirectMusicTool_GetMediaTypeArraySize
(
tool
,
&
value
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
value
==
0
,
"got %#lx
\n
"
,
value
);
hr
=
IDirectMusicTool_GetMediaTypes
(
tool
,
(
DWORD
**
)
&
types
,
64
);
ok
(
hr
==
E_NOTIMPL
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicTool_ProcessPMsg
(
tool
,
performance
,
&
msg
);
todo_wine
ok
(
hr
==
DMUS_S_FREE
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicTool_Flush
(
tool
,
performance
,
&
msg
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
IDirectMusicGraph_Release
(
graph
);
IDirectMusicTool_Release
(
tool
);
skip_tool:
IDirectMusicPerformance_Release
(
performance
);
}
START_TEST
(
dmime
)
START_TEST
(
dmime
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -1428,6 +1501,7 @@ START_TEST(dmime)
...
@@ -1428,6 +1501,7 @@ START_TEST(dmime)
test_segment_param
();
test_segment_param
();
test_track
();
test_track
();
test_parsedescriptor
();
test_parsedescriptor
();
test_performance_tool
();
CoUninitialize
();
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