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
14ff4bfe
Commit
14ff4bfe
authored
Jun 13, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask/tests: Add some tests for workitem data.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c5d945c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
task.c
dlls/mstask/tests/task.c
+55
-0
No files found.
dlls/mstask/tests/task.c
View file @
14ff4bfe
...
...
@@ -720,6 +720,60 @@ static void test_SetFlags(void)
ITask_Release
(
task
);
}
static
void
test_workitem_data
(
void
)
{
static
BYTE
hello
[]
=
"Hello World!"
;
HRESULT
hr
;
ITask
*
task
;
WORD
count
;
BYTE
*
data
;
hr
=
ITaskScheduler_NewWorkItem
(
scheduler
,
task_name
,
&
CLSID_CTask
,
&
IID_ITask
,
(
IUnknown
**
)
&
task
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
if
(
0
)
/* crashes under Windows */
hr
=
ITask_GetWorkItemData
(
task
,
&
count
,
NULL
);
if
(
0
)
/* crashes under Windows */
hr
=
ITask_GetWorkItemData
(
task
,
NULL
,
&
data
);
count
=
0xdead
;
data
=
(
BYTE
*
)
0xdeadbeef
;
hr
=
ITask_GetWorkItemData
(
task
,
&
count
,
&
data
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
count
==
0
,
"got %u
\n
"
,
count
);
ok
(
data
==
NULL
,
"got %p
\n
"
,
data
);
hr
=
ITask_SetWorkItemData
(
task
,
sizeof
(
hello
),
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %#x
\n
"
,
hr
);
hr
=
ITask_SetWorkItemData
(
task
,
0
,
hello
);
ok
(
hr
==
E_INVALIDARG
,
"got %#x
\n
"
,
hr
);
hr
=
ITask_SetWorkItemData
(
task
,
sizeof
(
hello
),
hello
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
count
=
0xdead
;
data
=
NULL
;
hr
=
ITask_GetWorkItemData
(
task
,
&
count
,
&
data
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
count
==
sizeof
(
hello
),
"got %u
\n
"
,
count
);
ok
(
data
!=
NULL
,
"got NULL
\n
"
);
ok
(
!
memcmp
(
data
,
hello
,
sizeof
(
hello
)),
"data mismatch
\n
"
);
hr
=
ITask_SetWorkItemData
(
task
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
count
=
0xdead
;
data
=
(
BYTE
*
)
0xdeadbeef
;
hr
=
ITask_GetWorkItemData
(
task
,
&
count
,
&
data
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
count
==
0
,
"got %u
\n
"
,
count
);
ok
(
data
==
NULL
,
"got %p
\n
"
,
data
);
ITask_Release
(
task
);
}
START_TEST
(
task
)
{
HRESULT
hr
;
...
...
@@ -738,6 +792,7 @@ START_TEST(task)
test_task_state
();
test_Run
();
test_SetFlags
();
test_workitem_data
();
ITaskScheduler_Release
(
scheduler
);
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