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
340bf9b5
Commit
340bf9b5
authored
May 14, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask/tests: Make task trigger tests independent.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bad78747
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
42 deletions
+12
-42
task_trigger.c
dlls/mstask/tests/task_trigger.c
+12
-42
No files found.
dlls/mstask/tests/task_trigger.c
View file @
340bf9b5
...
...
@@ -27,37 +27,6 @@
#include "wine/test.h"
static
ITaskScheduler
*
test_task_scheduler
;
static
ITask
*
test_task
;
static
ITaskTrigger
*
test_trigger
;
static
WORD
trigger_index
;
static
BOOL
setup_trigger
(
void
)
{
HRESULT
hres
;
const
WCHAR
task_name
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'i'
,
'n'
,
'g'
,
0
};
hres
=
ITaskScheduler_NewWorkItem
(
test_task_scheduler
,
task_name
,
&
CLSID_CTask
,
&
IID_ITask
,
(
IUnknown
**
)
&
test_task
);
if
(
hres
!=
S_OK
)
{
ITaskScheduler_Release
(
test_task_scheduler
);
return
FALSE
;
}
hres
=
ITask_CreateTrigger
(
test_task
,
&
trigger_index
,
&
test_trigger
);
if
(
hres
!=
S_OK
)
{
ITask_Release
(
test_task
);
ITaskScheduler_Release
(
test_task_scheduler
);
return
FALSE
;
}
return
TRUE
;
}
static
void
cleanup_trigger
(
void
)
{
ITaskTrigger_Release
(
test_trigger
);
ITask_Release
(
test_task
);
}
static
BOOL
compare_trigger_state
(
TASK_TRIGGER
found_state
,
TASK_TRIGGER
expected_state
)
...
...
@@ -135,8 +104,11 @@ static BOOL compare_trigger_state(TASK_TRIGGER found_state,
static
void
test_SetTrigger_GetTrigger
(
void
)
{
BOOL
setup
;
static
const
WCHAR
task_name
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'i'
,
'n'
,
'g'
,
0
};
ITask
*
test_task
;
ITaskTrigger
*
test_trigger
;
HRESULT
hres
;
WORD
idx
;
TASK_TRIGGER
trigger_state
;
TASK_TRIGGER
empty_trigger_state
=
{
sizeof
(
trigger_state
),
0
,
...
...
@@ -157,13 +129,12 @@ static void test_SetTrigger_GetTrigger(void)
};
SYSTEMTIME
time
;
setup
=
setup_trigger
();
ok
(
setup
,
"Failed to setup test_task
\n
"
);
if
(
!
setup
)
{
skip
(
"Failed to create task. Skipping tests.
\n
"
);
return
;
}
hres
=
ITaskScheduler_NewWorkItem
(
test_task_scheduler
,
task_name
,
&
CLSID_CTask
,
&
IID_ITask
,
(
IUnknown
**
)
&
test_task
);
ok
(
hres
==
S_OK
,
"got %#x
\n
"
,
hres
);
hres
=
ITask_CreateTrigger
(
test_task
,
&
idx
,
&
test_trigger
);
ok
(
hres
==
S_OK
,
"got %#x
\n
"
,
hres
);
/* Setup a trigger with base values for this test run */
GetLocalTime
(
&
time
);
...
...
@@ -367,9 +338,8 @@ static void test_SetTrigger_GetTrigger(void)
ok
(
compare_trigger_state
(
trigger_state
,
normal_trigger_state
),
"Invalid state
\n
"
);
cleanup_trigger
();
return
;
ITaskTrigger_Release
(
test_trigger
);
ITask_Release
(
test_task
);
}
static
void
test_task_trigger
(
void
)
...
...
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