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
b789c44b
Commit
b789c44b
authored
Mar 14, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add some tests for advising from system clock.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
94063ac1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
systemclock.c
dlls/quartz/tests/systemclock.c
+83
-0
No files found.
dlls/quartz/tests/systemclock.c
View file @
b789c44b
...
...
@@ -96,6 +96,88 @@ static void test_get_time(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_advise
(
void
)
{
IReferenceClock
*
clock
=
create_system_clock
();
HANDLE
event
,
semaphore
;
REFERENCE_TIME
current
;
DWORD_PTR
cookie
;
unsigned
int
i
;
HRESULT
hr
;
ULONG
ref
;
event
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
semaphore
=
CreateSemaphoreA
(
NULL
,
0
,
10
,
NULL
);
hr
=
IReferenceClock_GetTime
(
clock
,
&
current
);
ok
(
SUCCEEDED
(
hr
),
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdviseTime
(
clock
,
current
,
500
*
10000
,
(
HEVENT
)
event
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdviseTime
(
clock
,
-
1000
*
10000
,
500
*
10000
,
(
HEVENT
)
event
,
&
cookie
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdviseTime
(
clock
,
current
,
500
*
10000
,
(
HEVENT
)
event
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
WaitForSingleObject
(
event
,
480
)
==
WAIT_TIMEOUT
,
"Event should not be signaled.
\n
"
);
ok
(
!
WaitForSingleObject
(
event
,
40
),
"Event should be signaled.
\n
"
);
hr
=
IReferenceClock_Unadvise
(
clock
,
cookie
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ResetEvent
(
event
);
hr
=
IReferenceClock_GetTime
(
clock
,
&
current
);
ok
(
SUCCEEDED
(
hr
),
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdviseTime
(
clock
,
current
,
500
*
10000
,
(
HEVENT
)
event
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_Unadvise
(
clock
,
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
WaitForSingleObject
(
event
,
520
)
==
WAIT_TIMEOUT
,
"Event should not be signaled.
\n
"
);
ResetEvent
(
event
);
hr
=
IReferenceClock_GetTime
(
clock
,
&
current
);
ok
(
SUCCEEDED
(
hr
),
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdviseTime
(
clock
,
current
+
500
*
10000
,
0
,
(
HEVENT
)
event
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
WaitForSingleObject
(
event
,
480
)
==
WAIT_TIMEOUT
,
"Event should not be signaled.
\n
"
);
ok
(
!
WaitForSingleObject
(
event
,
40
),
"Event should be signaled.
\n
"
);
hr
=
IReferenceClock_GetTime
(
clock
,
&
current
);
ok
(
SUCCEEDED
(
hr
),
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdvisePeriodic
(
clock
,
current
,
500
*
10000
,
(
HSEMAPHORE
)
semaphore
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdvisePeriodic
(
clock
,
current
,
0
,
(
HSEMAPHORE
)
semaphore
,
&
cookie
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdvisePeriodic
(
clock
,
current
,
-
500
*
10000
,
(
HSEMAPHORE
)
semaphore
,
&
cookie
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdvisePeriodic
(
clock
,
-
500
*
10000
,
1000
*
10000
,
(
HSEMAPHORE
)
semaphore
,
&
cookie
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdvisePeriodic
(
clock
,
current
,
500
*
10000
,
(
HSEMAPHORE
)
semaphore
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
WaitForSingleObject
(
semaphore
,
10
),
"Semaphore should be signaled.
\n
"
);
for
(
i
=
0
;
i
<
5
;
++
i
)
{
ok
(
WaitForSingleObject
(
semaphore
,
480
)
==
WAIT_TIMEOUT
,
"Semaphore should not be signaled.
\n
"
);
ok
(
!
WaitForSingleObject
(
semaphore
,
40
),
"Semaphore should be signaled.
\n
"
);
}
hr
=
IReferenceClock_Unadvise
(
clock
,
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
WaitForSingleObject
(
semaphore
,
520
)
==
WAIT_TIMEOUT
,
"Semaphore should not be signaled.
\n
"
);
CloseHandle
(
event
);
CloseHandle
(
semaphore
);
ref
=
IReferenceClock_Release
(
clock
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
systemclock
)
{
CoInitialize
(
NULL
);
...
...
@@ -104,6 +186,7 @@ START_TEST(systemclock)
test_interfaces
();
test_get_time
();
test_advise
();
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