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
859f9bac
Commit
859f9bac
authored
Mar 01, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Add some tests for serial queues.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c0759107
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletion
+61
-1
mfplat.c
dlls/mfplat/tests/mfplat.c
+61
-1
No files found.
dlls/mfplat/tests/mfplat.c
View file @
859f9bac
...
...
@@ -44,6 +44,7 @@ static HRESULT (WINAPI *pMFCreateMemoryBuffer)(DWORD max_length, IMFMediaBuffer
static
void
*
(
WINAPI
*
pMFHeapAlloc
)(
SIZE_T
size
,
ULONG
flags
,
char
*
file
,
int
line
,
EAllocationType
type
);
static
void
(
WINAPI
*
pMFHeapFree
)(
void
*
p
);
static
HRESULT
(
WINAPI
*
pMFPutWaitingWorkItem
)(
HANDLE
event
,
LONG
priority
,
IMFAsyncResult
*
result
,
MFWORKITEM_KEY
*
key
);
static
HRESULT
(
WINAPI
*
pMFAllocateSerialWorkQueue
)(
DWORD
queue
,
DWORD
*
serial_queue
);
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
...
...
@@ -312,7 +313,8 @@ static void init_functions(void)
{
HMODULE
mod
=
GetModuleHandleA
(
"mfplat.dll"
);
#define X(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return;
#define X(f) p##f = (void*)GetProcAddress(mod, #f)
X
(
MFAllocateSerialWorkQueue
);
X
(
MFCopyImage
);
X
(
MFCreateSourceResolver
);
X
(
MFCreateMFByteStreamOnStream
);
...
...
@@ -1092,6 +1094,63 @@ todo_wine
ok
(
hr
==
S_OK
,
"Failed to shutdown, hr %#x.
\n
"
,
hr
);
}
static
void
test_serial_queue
(
void
)
{
static
const
DWORD
queue_ids
[]
=
{
MFASYNC_CALLBACK_QUEUE_STANDARD
,
MFASYNC_CALLBACK_QUEUE_RT
,
MFASYNC_CALLBACK_QUEUE_IO
,
MFASYNC_CALLBACK_QUEUE_TIMER
,
MFASYNC_CALLBACK_QUEUE_MULTITHREADED
,
MFASYNC_CALLBACK_QUEUE_LONG_FUNCTION
,
};
DWORD
queue
,
serial_queue
;
unsigned
int
i
;
HRESULT
hr
;
if
(
!
pMFAllocateSerialWorkQueue
)
{
skip
(
"Serial queues are not supported.
\n
"
);
return
;
}
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
queue_ids
);
++
i
)
{
BOOL
broken_types
=
queue_ids
[
i
]
==
MFASYNC_CALLBACK_QUEUE_TIMER
||
queue_ids
[
i
]
==
MFASYNC_CALLBACK_QUEUE_LONG_FUNCTION
;
hr
=
pMFAllocateSerialWorkQueue
(
queue_ids
[
i
],
&
serial_queue
);
ok
(
hr
==
S_OK
||
broken
(
broken_types
&&
hr
==
E_INVALIDARG
)
/* Win8 */
,
"%u: failed to allocate a queue, hr %#x.
\n
"
,
i
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
MFUnlockWorkQueue
(
serial_queue
);
ok
(
hr
==
S_OK
,
"%u: failed to unlock the queue, hr %#x.
\n
"
,
i
,
hr
);
}
}
/* Chain them together. */
hr
=
pMFAllocateSerialWorkQueue
(
MFASYNC_CALLBACK_QUEUE_STANDARD
,
&
serial_queue
);
ok
(
hr
==
S_OK
,
"Failed to allocate a queue, hr %#x.
\n
"
,
hr
);
hr
=
pMFAllocateSerialWorkQueue
(
serial_queue
,
&
queue
);
ok
(
hr
==
S_OK
,
"Failed to allocate a queue, hr %#x.
\n
"
,
hr
);
hr
=
MFUnlockWorkQueue
(
serial_queue
);
ok
(
hr
==
S_OK
,
"Failed to unlock the queue, hr %#x.
\n
"
,
hr
);
hr
=
MFUnlockWorkQueue
(
queue
);
ok
(
hr
==
S_OK
,
"Failed to unlock the queue, hr %#x.
\n
"
,
hr
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
}
START_TEST
(
mfplat
)
{
CoInitialize
(
NULL
);
...
...
@@ -1114,6 +1173,7 @@ START_TEST(mfplat)
test_MFCreateCollection
();
test_MFHeapAlloc
();
test_scheduled_items
();
test_serial_queue
();
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