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
b1c6d5b1
Commit
b1c6d5b1
authored
Mar 03, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32/tests: Add WAVFile COM tests.
parent
8e9cacf0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
api.c
dlls/avifil32/tests/api.c
+63
-0
No files found.
dlls/avifil32/tests/api.c
View file @
b1c6d5b1
...
...
@@ -29,6 +29,7 @@
/* ########################### */
DEFINE_AVIGUID
(
CLSID_WAVFile
,
0x00020003
,
0
,
0
);
static
const
CHAR
winetest0
[]
=
"winetest0"
;
static
const
CHAR
winetest1
[]
=
"winetest1"
;
static
const
CHAR
testfilename
[]
=
"wine_avifil32_test.avi"
;
...
...
@@ -648,6 +649,67 @@ static void test_COM(void)
while
(
IAVIFile_Release
(
avif
));
}
static
void
test_COM_wavfile
(
void
)
{
struct
unk_impl
unk_obj
=
{{
&
unk_vtbl
},
19
,
NULL
};
IAVIFile
*
avif
=
NULL
;
IPersistFile
*
pf
;
IAVIStream
*
avis
;
IUnknown
*
unk
;
ULONG
refcount
;
HRESULT
hr
;
/* COM aggregation */
hr
=
CoCreateInstance
(
&
CLSID_WAVFile
,
&
unk_obj
.
IUnknown_iface
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk_obj
.
inner_unk
);
ok
(
hr
==
S_OK
,
"COM aggregation failed: %08x, expected S_OK
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
&
unk_obj
.
IUnknown_iface
,
&
IID_IAVIFile
,
(
void
**
)
&
avif
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IAVIFile failed: %08x
\n
"
,
hr
);
refcount
=
IAVIFile_AddRef
(
avif
);
ok
(
refcount
==
unk_obj
.
ref
,
"WAVFile just pretends to support COM aggregation
\n
"
);
refcount
=
IAVIFile_Release
(
avif
);
ok
(
refcount
==
unk_obj
.
ref
,
"WAVFile just pretends to support COM aggregation
\n
"
);
hr
=
IAVIFile_QueryInterface
(
avif
,
&
IID_IPersistFile
,
(
void
**
)
&
pf
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersistFile failed: %08x
\n
"
,
hr
);
refcount
=
IPersistFile_Release
(
pf
);
ok
(
refcount
==
unk_obj
.
ref
,
"WAVFile just pretends to support COM aggregation
\n
"
);
refcount
=
IAVIFile_Release
(
avif
);
ok
(
refcount
==
19
,
"Outer ref count should be back at 19 but is %d
\n
"
,
refcount
);
refcount
=
IUnknown_Release
(
unk_obj
.
inner_unk
);
ok
(
refcount
==
0
,
"Inner ref count should be 0 but is %u
\n
"
,
refcount
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_WAVFile
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IAVIStreaming
,
(
void
**
)
&
avif
);
ok
(
hr
==
E_NOINTERFACE
,
"WAVFile create failed: %08x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount for all WAVFile interfaces */
hr
=
CoCreateInstance
(
&
CLSID_WAVFile
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IAVIFile
,
(
void
**
)
&
avif
);
ok
(
hr
==
S_OK
,
"WAVFile create failed: %08x, expected S_OK
\n
"
,
hr
);
refcount
=
IAVIFile_AddRef
(
avif
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IAVIFile_QueryInterface
(
avif
,
&
IID_IPersistFile
,
(
void
**
)
&
pf
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersistFile failed: %08x
\n
"
,
hr
);
refcount
=
IPersistFile_AddRef
(
pf
);
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
refcount
=
IPersistFile_Release
(
pf
);
hr
=
IAVIFile_QueryInterface
(
avif
,
&
IID_IAVIStream
,
(
void
**
)
&
avis
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IAVIStream failed: %08x
\n
"
,
hr
);
refcount
=
IAVIStream_AddRef
(
avis
);
ok
(
refcount
==
5
,
"refcount == %u, expected 5
\n
"
,
refcount
);
refcount
=
IAVIStream_Release
(
avis
);
hr
=
IAVIFile_QueryInterface
(
avif
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk
);
ok
(
refcount
==
6
,
"refcount == %u, expected 6
\n
"
,
refcount
);
refcount
=
IUnknown_Release
(
unk
);
while
(
IAVIFile_Release
(
avif
));
}
START_TEST
(
api
)
{
...
...
@@ -659,6 +721,7 @@ START_TEST(api)
test_ash1_corruption
();
test_ash1_corruption2
();
test_COM
();
test_COM_wavfile
();
AVIFileExit
();
}
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