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
0c51f462
Commit
0c51f462
authored
Aug 22, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmvcore/tests: Test IWMSyncReader2_(Get|Set)AllocateFor(Output|Stream).
parent
8bfb1ecf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
147 additions
and
0 deletions
+147
-0
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+147
-0
No files found.
dlls/wmvcore/tests/wmvcore.c
View file @
0c51f462
...
...
@@ -3413,6 +3413,152 @@ static void test_async_reader_file(void)
ok
(
ret
,
"Failed to delete %s, error %lu.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
}
static
void
test_sync_reader_allocator
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
L"test.wmv"
);
IWMReaderAllocatorEx
*
allocator
;
struct
teststream
stream
;
struct
callback
callback
;
IWMSyncReader2
*
reader
;
HANDLE
file
;
HRESULT
hr
;
BOOL
ret
;
callback_init
(
&
callback
);
hr
=
WMCreateSyncReader
(
NULL
,
0
,
(
IWMSyncReader
**
)
&
reader
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
file
=
CreateFileW
(
filename
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failed to open %s, error %lu.
\n
"
,
debugstr_w
(
file
),
GetLastError
());
teststream_init
(
&
stream
,
file
);
hr
=
IWMSyncReader2_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
stream
.
refcount
>
1
,
"Got refcount %ld.
\n
"
,
stream
.
refcount
);
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
-
1
,
&
allocator
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
0
,
&
allocator
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
1
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader2_SetAllocateForOutput
(
reader
,
-
1
,
&
callback
.
IWMReaderAllocatorEx_iface
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IWMSyncReader2_SetAllocateForStream
(
reader
,
0
,
&
callback
.
IWMReaderAllocatorEx_iface
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
0
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
1
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
hr
=
IWMSyncReader2_SetAllocateForStream
(
reader
,
1
,
&
callback
.
IWMReaderAllocatorEx_iface
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
0
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
2
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
1
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
allocator
==
&
callback
.
IWMReaderAllocatorEx_iface
,
"Got allocator %p.
\n
"
,
allocator
);
hr
=
IWMSyncReader2_SetAllocateForStream
(
reader
,
1
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
0
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
1
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
hr
=
IWMSyncReader2_SetAllocateForOutput
(
reader
,
0
,
&
callback
.
IWMReaderAllocatorEx_iface
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
1
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
1
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
0
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
allocator
==
&
callback
.
IWMReaderAllocatorEx_iface
,
"Got allocator %p.
\n
"
,
allocator
);
hr
=
IWMSyncReader2_SetAllocateForOutput
(
reader
,
0
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForOutput
(
reader
,
0
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
allocator
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader2_GetAllocateForStream
(
reader
,
1
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
allocator
,
"Got allocator %p.
\n
"
,
allocator
);
IWMSyncReader2_Release
(
reader
);
ok
(
stream
.
refcount
==
1
,
"Got outstanding refcount %ld.
\n
"
,
stream
.
refcount
);
CloseHandle
(
stream
.
file
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete %s, error %lu.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
callback_cleanup
(
&
callback
);
}
START_TEST
(
wmvcore
)
{
HRESULT
hr
;
...
...
@@ -3431,6 +3577,7 @@ START_TEST(wmvcore)
test_WMCreateWriterPriv
();
test_urlextension
();
test_iscontentprotected
();
test_sync_reader_allocator
();
test_sync_reader_settings
();
test_sync_reader_streaming
();
test_sync_reader_types
();
...
...
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