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
34a1917f
Commit
34a1917f
authored
Mar 26, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Mar 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream/tests: Make test.avi filename an unicode string and test the file presence once for all.
parent
91cc9ad5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
35 deletions
+21
-35
amstream.c
dlls/amstream/tests/amstream.c
+21
-35
No files found.
dlls/amstream/tests/amstream.c
View file @
34a1917f
/*
* Unit tests for MultiMedia Stream functions
*
* Copyright (C) 2009 Christian Costa
* Copyright (C) 2009
, 2012
Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -24,8 +24,7 @@
#include "initguid.h"
#include "amstream.h"
#define FILE_LEN 9
static
const
char
fileA
[
FILE_LEN
]
=
"test.avi"
;
static
const
WCHAR
filenameW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'a'
,
'v'
,
'i'
,
0
};
static
IAMMultiMediaStream
*
pams
;
static
IDirectDraw7
*
pdd7
;
...
...
@@ -88,22 +87,12 @@ static void release_directdraw(void)
static
void
test_openfile
(
void
)
{
HANDLE
h
;
HRESULT
hr
;
WCHAR
fileW
[
FILE_LEN
];
IGraphBuilder
*
pgraph
;
if
(
!
create_ammultimediastream
())
return
;
h
=
CreateFileA
(
fileA
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
)
{
release_ammultimediastream
();
return
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
fileA
,
-
1
,
fileW
,
FILE_LEN
);
hr
=
IAMMultiMediaStream_GetFilterGraph
(
pams
,
&
pgraph
);
ok
(
hr
==
S_OK
,
"IAMMultiMediaStream_GetFilterGraph returned: %x
\n
"
,
hr
);
ok
(
pgraph
==
NULL
,
"Filtergraph should not be created yet
\n
"
);
...
...
@@ -111,7 +100,7 @@ static void test_openfile(void)
if
(
pgraph
)
IGraphBuilder_Release
(
pgraph
);
hr
=
IAMMultiMediaStream_OpenFile
(
pams
,
fileW
,
0
);
hr
=
IAMMultiMediaStream_OpenFile
(
pams
,
file
name
W
,
0
);
ok
(
hr
==
S_OK
,
"IAMMultiMediaStream_OpenFile returned: %x
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_GetFilterGraph
(
pams
,
&
pgraph
);
...
...
@@ -124,18 +113,20 @@ static void test_openfile(void)
release_ammultimediastream
();
}
static
void
renderfile
(
const
char
*
fileA
)
static
void
test_renderfile
(
void
)
{
HRESULT
hr
;
WCHAR
fileW
[
FILE_LEN
];
IMediaStream
*
pvidstream
=
NULL
;
IDirectDrawMediaStream
*
pddstream
=
NULL
;
IDirectDrawStreamSample
*
pddsample
=
NULL
;
if
(
!
create_ammultimediastream
())
return
;
if
(
!
create_directdraw
())
{
release_ammultimediastream
();
return
;
MultiByteToWideChar
(
CP_ACP
,
0
,
fileA
,
-
1
,
fileW
,
FILE_LEN
);
}
hr
=
IAMMultiMediaStream_Initialize
(
pams
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"IAMMultiMediaStream_Initialize returned: %x
\n
"
,
hr
);
...
...
@@ -146,7 +137,7 @@ static void renderfile(const char * fileA)
hr
=
IAMMultiMediaStream_AddMediaStream
(
pams
,
NULL
,
&
MSPID_PrimaryAudio
,
AMMSF_ADDDEFAULTRENDERER
,
NULL
);
ok
(
hr
==
S_OK
,
"IAMMultiMediaStream_AddMediaStream returned: %x
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_OpenFile
(
pams
,
fileW
,
0
);
hr
=
IAMMultiMediaStream_OpenFile
(
pams
,
file
name
W
,
0
);
ok
(
hr
==
S_OK
,
"IAMMultiMediaStream_OpenFile returned: %x
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_GetMediaStream
(
pams
,
&
MSPID_PrimaryVideo
,
&
pvidstream
);
...
...
@@ -169,28 +160,23 @@ error:
IMediaStream_Release
(
pvidstream
);
release_directdraw
();
release_ammultimediastream
();
}
static
void
test_render
(
void
)
START_TEST
(
amstream
)
{
HANDLE
h
;
HANDLE
file
;
if
(
!
create_ammultimediastream
())
return
;
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
h
=
CreateFileA
(
fileA
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
h
);
renderfile
(
fileA
);
}
file
=
CreateFileW
(
filenameW
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
file
);
release_ammultimediastream
();
}
test_openfile
();
test_renderfile
();
}
START_TEST
(
amstream
)
{
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
test_openfile
();
test_render
();
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