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
c3e4b3a3
Commit
c3e4b3a3
authored
Mar 13, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Clean up test_IReferenceClock_query_interface().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a71e6442
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
20 deletions
+35
-20
systemclock.c
dlls/quartz/tests/systemclock.c
+35
-20
No files found.
dlls/quartz/tests/systemclock.c
View file @
c3e4b3a3
/*
*
Unit tests for Direct Show functions - IReferenceClock
*
System clock unit tests
*
* Copyright (C) 2007 Alex Villacís Lasso
*
...
...
@@ -19,30 +19,45 @@
*/
#define COBJMACROS
#include "wine/test.h"
#include "uuids.h"
#include "dshow.h"
#include "
control
.h"
#include "
wine/test
.h"
static
void
test_IReferenceClock_query_interface
(
const
char
*
clockdesc
,
IReferenceClock
*
pClock
)
static
IReferenceClock
*
create_system_clock
(
void
)
{
HRESULT
hr
;
IUnknown
*
pF
;
IReferenceClock
*
filter
=
NULL
;
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_SystemClock
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IReferenceClock
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
return
filter
;
}
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static
void
check_interface_
(
unsigned
int
line
,
void
*
iface_ptr
,
REFIID
iid
,
BOOL
supported
)
{
IUnknown
*
iface
=
iface_ptr
;
HRESULT
hr
,
expected_hr
;
IUnknown
*
unk
;
expected_hr
=
supported
?
S_OK
:
E_NOINTERFACE
;
hr
=
IUnknown_QueryInterface
(
iface
,
iid
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
expected_hr
,
"Got hr %#x, expected %#x.
\n
"
,
hr
,
expected_hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
}
static
void
test_interfaces
(
void
)
{
IReferenceClock
*
clock
=
create_system_clock
();
ULONG
ref
;
hr
=
IReferenceClock_QueryInterface
(
pClock
,
&
IID_IUnknown
,
(
void
**
)
&
pF
);
ok
(
hr
==
S_OK
,
"IReferenceClock_QueryInterface returned %x
\n
"
,
hr
);
ok
(
pF
!=
NULL
,
"pF is NULL
\n
"
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
pF
);
check_interface
(
clock
,
&
IID_IReferenceClock
,
TRUE
);
check_interface
(
clock
,
&
IID_IUnknown
,
TRUE
);
hr
=
IReferenceClock_QueryInterface
(
pClock
,
&
IID_IDirectDraw
,
(
void
**
)
&
pF
);
ok
(
hr
==
E_NOINTERFACE
,
"IReferenceClock_QueryInterface returned %x
\n
"
,
hr
);
ok
(
pF
==
NULL
,
"pF is not NULL
\n
"
);
check_interface
(
clock
,
&
IID_IDirectDraw
,
FALSE
);
hr
=
IReferenceClock_QueryInterface
(
pClock
,
&
IID_IReferenceClock
,
(
void
**
)
&
pF
);
ok
(
hr
==
S_OK
,
"IReferenceClock_QueryInterface returned %x
\n
"
,
hr
);
ok
(
pF
!=
NULL
,
"pF is NULL
\n
"
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
pF
);
ref
=
IReferenceClock_Release
(
clock
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
/* The following method expects a reference clock that will keep ticking for
...
...
@@ -99,7 +114,6 @@ static void test_IReferenceClock_SystemClock(void)
ok
(
hr
==
S_OK
,
"Unable to create reference clock from system clock %x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
test_IReferenceClock_query_interface
(
"SystemClock"
,
pReferenceClock
);
test_IReferenceClock_methods
(
"SystemClock"
,
pReferenceClock
);
IReferenceClock_Release
(
pReferenceClock
);
}
...
...
@@ -109,6 +123,7 @@ START_TEST(systemclock)
{
CoInitialize
(
NULL
);
test_interfaces
();
test_IReferenceClock_SystemClock
();
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