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
ee806d9a
Commit
ee806d9a
authored
Feb 27, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd: Add more tests for RegisterTask, GetTask and DeleteTask.
parent
a2c90524
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
folder.c
dlls/taskschd/folder.c
+2
-0
scheduler.c
dlls/taskschd/tests/scheduler.c
+41
-0
No files found.
dlls/taskschd/folder.c
View file @
ee806d9a
...
...
@@ -325,6 +325,8 @@ static HRESULT WINAPI TaskFolder_RegisterTask(ITaskFolder *iface, BSTR name, BST
TRACE
(
"%p,%s,%s,%x,%s,%s,%d,%s,%p
\n
"
,
iface
,
debugstr_w
(
name
),
debugstr_w
(
xml
),
flags
,
debugstr_variant
(
&
user
),
debugstr_variant
(
&
password
),
logon
,
debugstr_variant
(
&
sddl
),
task
);
if
(
!
xml
)
return
HRESULT_FROM_WIN32
(
RPC_X_NULL_REF_POINTER
);
hr
=
TaskDefinition_create
(
&
taskdef
);
if
(
hr
!=
S_OK
)
return
hr
;
...
...
dlls/taskschd/tests/scheduler.c
View file @
ee806d9a
...
...
@@ -711,6 +711,7 @@ static void test_GetTask(void)
ITaskService
*
service
;
ITaskFolder
*
root
,
*
folder
;
IRegisteredTask
*
task1
,
*
task2
;
IID
iid
;
hr
=
CoCreateInstance
(
&
CLSID_TaskScheduler
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ITaskService
,
(
void
**
)
&
service
);
if
(
hr
!=
S_OK
)
...
...
@@ -732,11 +733,28 @@ static void test_GetTask(void)
ITaskFolder_DeleteTask
(
root
,
Wine_Task2
,
0
);
ITaskFolder_DeleteFolder
(
root
,
Wine
,
0
);
if
(
0
)
/* FIXME: Uncomment once implemented */
{
hr
=
ITaskFolder_GetTask
(
root
,
Wine_Task1
,
&
task1
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"expected ERROR_PATH_NOT_FOUND, got %#x
\n
"
,
hr
);
}
hr
=
ITaskFolder_CreateFolder
(
root
,
Wine
,
v_null
,
&
folder
);
ok
(
hr
==
S_OK
,
"CreateFolder error %#x
\n
"
,
hr
);
if
(
0
)
/* FIXME: Uncomment once implemented */
{
hr
=
ITaskFolder_GetTask
(
root
,
Wine
,
&
task1
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"expected ERROR_PATH_NOT_FOUND, got %#x
\n
"
,
hr
);
}
MultiByteToWideChar
(
CP_ACP
,
0
,
xml1
,
-
1
,
xmlW
,
sizeof
(
xmlW
)
/
sizeof
(
xmlW
[
0
]));
hr
=
ITaskFolder_RegisterTask
(
root
,
Wine_Task1
,
NULL
,
TASK_CREATE
,
v_null
,
v_null
,
TASK_LOGON_NONE
,
v_null
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
RPC_X_NULL_REF_POINTER
),
"expected RPC_X_NULL_REF_POINTER, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_RegisterTask
(
root
,
Wine
,
xmlW
,
TASK_CREATE
,
v_null
,
v_null
,
TASK_LOGON_NONE
,
v_null
,
NULL
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ACCESS_DENIED
),
"expected ERROR_ACCESS_DENIED, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_RegisterTask
(
root
,
Wine_Task1
,
xmlW
,
TASK_CREATE
,
v_null
,
v_null
,
TASK_LOGON_NONE
,
v_null
,
NULL
);
ok
(
hr
==
S_OK
,
"RegisterTask error %#x
\n
"
,
hr
);
...
...
@@ -744,6 +762,10 @@ static void test_GetTask(void)
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ALREADY_EXISTS
),
"expected ERROR_ALREADY_EXISTS, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_RegisterTask
(
root
,
Wine_Task1
,
xmlW
,
0
,
v_null
,
v_null
,
TASK_LOGON_NONE
,
v_null
,
NULL
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_ALREADY_EXISTS
),
"expected ERROR_ALREADY_EXISTS, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_RegisterTask
(
root
,
Wine_Task1
,
xmlW
,
TASK_CREATE_OR_UPDATE
,
v_null
,
v_null
,
TASK_LOGON_NONE
,
v_null
,
&
task1
);
ok
(
hr
==
S_OK
,
"RegisterTask error %#x
\n
"
,
hr
);
...
...
@@ -851,11 +873,30 @@ todo_wine
IRegisteredTask_Release
(
task2
);
hr
=
ITaskFolder_DeleteTask
(
folder
,
NULL
,
0
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_DIR_NOT_EMPTY
),
"expected ERROR_DIR_NOT_EMPTY, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_DeleteTask
(
root
,
Wine_Task1
,
0
);
ok
(
hr
==
S_OK
,
"DeleteTask error %#x
\n
"
,
hr
);
hr
=
ITaskFolder_DeleteTask
(
folder
,
Task2
,
0
);
ok
(
hr
==
S_OK
,
"DeleteTask error %#x
\n
"
,
hr
);
hr
=
ITaskFolder_DeleteTask
(
folder
,
Task2
,
0
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"expected ERROR_FILE_NOT_FOUND, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_RegisterTask
(
root
,
NULL
,
xmlW
,
TASK_CREATE
,
v_null
,
v_null
,
TASK_LOGON_NONE
,
v_null
,
&
task1
);
ok
(
hr
==
S_OK
,
"RegisterTask error %#x
\n
"
,
hr
);
hr
=
IRegisteredTask_get_Name
(
task1
,
&
bstr
);
ok
(
hr
==
S_OK
,
"get_Name error %#x
\n
"
,
hr
);
hr
=
IIDFromString
(
bstr
,
&
iid
);
ok
(
hr
==
S_OK
,
"IIDFromString error %#x
\n
"
,
hr
);
IRegisteredTask_Release
(
task1
);
hr
=
ITaskFolder_DeleteTask
(
root
,
bstr
,
0
);
ok
(
hr
==
S_OK
,
"DeleteTask error %#x
\n
"
,
hr
);
failed:
ITaskFolder_Release
(
folder
);
...
...
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