#include "corerror.h"
#include "initguid.h"
#include "mstask.h"
#include "wine/test.h"
Go to the source code of this file.
|
static ITaskScheduler * | test_task_scheduler |
|
static const WCHAR | does_not_existW [] = {'\\','\\','d','o','e','s','_','n','o','t','_','e','x','i','s','t',0} |
|
◆ COBJMACROS
◆ START_TEST()
START_TEST |
( |
task_scheduler |
| ) |
|
Definition at line 234 of file task_scheduler.c.
235{
243}
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static void test_Activate(void)
static void test_SetTargetComputer(void)
static void test_Enum(void)
static void test_GetTargetComputer(void)
static void test_NewWorkItem(void)
◆ test_Activate()
Definition at line 81 of file task_scheduler.c.
82{
85 const WCHAR not_task_name[] =
86 {'N', 'o', 'S', 'u', 'c', 'h', 'T', 'a', 's', 'k', 0};
87
88
91 ok(
hres ==
S_OK,
"CTaskScheduler CoCreateInstance failed: %08x\n",
hres);
93 {
94 skip(
"Failed to create task scheduler. Skipping tests.\n");
95 return;
96 }
97
98
102
104 return;
105}
#define COR_E_FILENOTFOUND
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
static ITaskScheduler * test_task_scheduler
Referenced by START_TEST().
◆ test_Enum()
Definition at line 212 of file task_scheduler.c.
213{
217
219 &IID_ITaskScheduler, (void **)&scheduler);
221
222if (0) {
223 hr = ITaskScheduler_Enum(scheduler,
NULL);
225}
226
227 hr = ITaskScheduler_Enum(scheduler, &tasks);
229 IEnumWorkItems_Release(tasks);
230
231 ITaskScheduler_Release(scheduler);
232}
Referenced by START_TEST().
◆ test_GetTargetComputer()
static void test_GetTargetComputer |
( |
void |
| ) |
|
|
static |
Definition at line 107 of file task_scheduler.c.
108{
111
112
115 ok(
hres ==
S_OK,
"CTaskScheduler CoCreateInstance failed: %08x\n",
hres);
117 {
118 skip(
"Failed to create task scheduler.\n");
119 return;
120 }
121
122 if (0)
123 {
124
127 }
128
130 ok((
hres ==
S_OK) && oldname && oldname[0] ==
'\\' && oldname[1] ==
'\\' && oldname[2],
131 "got 0x%x and %s (expected S_OK and an unc name)\n",
hres,
wine_dbgstr_w(oldname));
132
134
136 return;
137}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Referenced by START_TEST().
◆ test_NewWorkItem()
Definition at line 33 of file task_scheduler.c.
34{
37 const WCHAR task_name[] = {
'T',
'e',
's',
't',
'i',
'n',
'g', 0};
39
40
42
43
46 ok(
hres ==
S_OK,
"CTaskScheduler CoCreateInstance failed: %08x\n",
hres);
48 {
49 skip(
"Failed to create task scheduler. Skipping tests.\n");
50 return;
51 }
52
53
55 &CLSID_CTask, &IID_ITask, (
IUnknown**)&task);
58 ITask_Release(task);
59
60
62 &GUID_BAD, &IID_ITask, (
IUnknown**)&task);
64 "Expected CLASS_E_CLASSNOTAVAILABLE: %08x\n",
hres);
65
66
68 &CLSID_CTask, &GUID_BAD, (
IUnknown**)&task);
70
71
73 &GUID_BAD, &GUID_BAD, (
IUnknown**)&task);
75 "Expected CLASS_E_CLASSNOTAVAILABLE: %08x\n",
hres);
76
78 return;
79}
HRESULT WINAPI CoCreateGuid(GUID *pguid)
#define CLASS_E_CLASSNOTAVAILABLE
Referenced by START_TEST().
◆ test_SetTargetComputer()
static void test_SetTargetComputer |
( |
void |
| ) |
|
|
static |
Definition at line 139 of file task_scheduler.c.
140{
146
147
151 return;
152
153
156 ok(
hres ==
S_OK,
"CTaskScheduler CoCreateInstance failed: %08x\n",
hres);
158 {
159 skip(
"Failed to create task scheduler. Skipping tests.\n");
160 return;
161 }
162
165
166
171 "got 0x%x with %s (expected S_OK and %s)\n",
174
175
178
181 "got 0x%x with %s (expected S_OK and %s)\n",
184
185
188 {
189 skip(
"SetTargetComputer failed with E_ACCESSDENIED (needs admin rights)\n");
190 goto done;
191 }
193
194
201
202
205
206done:
209 return;
210}
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
static const WCHAR does_not_existW[]
#define MAX_COMPUTERNAME_LENGTH
#define ERROR_BAD_NETPATH
#define HRESULT_FROM_WIN32(x)
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
Referenced by START_TEST().
◆ does_not_existW
const WCHAR does_not_existW[] = {'\\','\\','d','o','e','s','_','n','o','t','_','e','x','i','s','t',0} |
|
static |
◆ test_task_scheduler