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
653bc4fa
Commit
653bc4fa
authored
Feb 22, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests/filesource: Add tests for IAsyncReader_SyncReadAligned().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eccffa48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
filesource.c
dlls/quartz/tests/filesource.c
+73
-0
No files found.
dlls/quartz/tests/filesource.c
View file @
653bc4fa
...
...
@@ -666,11 +666,71 @@ todo_wine
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_sync_read_aligned
(
IAsyncReader
*
reader
,
IMemAllocator
*
allocator
)
{
REFERENCE_TIME
start_time
,
end_time
;
IMediaSample
*
sample
;
HRESULT
hr
;
BYTE
*
data
;
LONG
len
;
int
i
;
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
0
);
IMediaSample_GetPointer
(
sample
,
&
data
);
start_time
=
0
;
end_time
=
512
*
(
LONGLONG
)
10000000
;
hr
=
IMediaSample_SetTime
(
sample
,
&
start_time
,
&
end_time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAsyncReader_SyncReadAligned
(
reader
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
len
=
IMediaSample_GetActualDataLength
(
sample
);
todo_wine
ok
(
len
==
512
,
"Got length %d.
\n
"
,
len
);
for
(
i
=
0
;
i
<
512
;
i
++
)
ok
(
data
[
i
]
==
i
%
111
,
"Got wrong byte %02x at %u.
\n
"
,
data
[
i
],
i
);
start_time
=
512
*
(
LONGLONG
)
10000000
;
end_time
=
1024
*
(
LONGLONG
)
10000000
;
hr
=
IMediaSample_SetTime
(
sample
,
&
start_time
,
&
end_time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAsyncReader_SyncReadAligned
(
reader
,
sample
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
len
=
IMediaSample_GetActualDataLength
(
sample
);
todo_wine
ok
(
len
==
88
,
"Got length %d.
\n
"
,
len
);
for
(
i
=
0
;
i
<
88
;
i
++
)
ok
(
data
[
i
]
==
(
512
+
i
)
%
111
,
"Got wrong byte %02x at %u.
\n
"
,
data
[
i
],
i
);
start_time
=
1024
*
(
LONGLONG
)
10000000
;
end_time
=
1536
*
(
LONGLONG
)
10000000
;
hr
=
IMediaSample_SetTime
(
sample
,
&
start_time
,
&
end_time
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAsyncReader_SyncReadAligned
(
reader
,
sample
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
len
=
IMediaSample_GetActualDataLength
(
sample
);
todo_wine
ok
(
len
==
0
,
"Got length %d.
\n
"
,
len
);
IMediaSample_Release
(
sample
);
}
static
void
test_async_reader
(
void
)
{
ALLOCATOR_PROPERTIES
req_props
=
{
2
,
1024
,
512
,
0
},
ret_props
;
IBaseFilter
*
filter
=
create_file_source
();
IFileSourceFilter
*
filesource
;
LONGLONG
length
,
available
;
IMemAllocator
*
allocator
;
WCHAR
filename
[
MAX_PATH
];
IAsyncReader
*
reader
;
BYTE
buffer
[
20
];
...
...
@@ -733,6 +793,19 @@ static void test_async_reader(void)
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
buffer
[
0
]
==
0xcc
,
"Got wrong byte %02x.
\n
"
,
buffer
[
0
]);
ret_props
=
req_props
;
hr
=
IAsyncReader_RequestAllocator
(
reader
,
NULL
,
&
ret_props
,
&
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
ret_props
.
cBuffers
==
2
,
"Got %d buffers.
\n
"
,
ret_props
.
cBuffers
);
ok
(
ret_props
.
cbBuffer
==
1024
,
"Got size %d.
\n
"
,
ret_props
.
cbBuffer
);
ok
(
ret_props
.
cbAlign
==
512
,
"Got alignment %d.
\n
"
,
ret_props
.
cbAlign
);
ok
(
ret_props
.
cbPrefix
==
0
,
"Got prefix %d.
\n
"
,
ret_props
.
cbPrefix
);
IMemAllocator_Commit
(
allocator
);
test_sync_read_aligned
(
reader
,
allocator
);
IMemAllocator_Release
(
allocator
);
IAsyncReader_Release
(
reader
);
IPin_Release
(
pin
);
IFileSourceFilter_Release
(
filesource
);
...
...
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