[PATCH 5/5] taskschd/tests: Add more tests for actions.

Dmitry Timoshkov dmitry at baikal.ru
Mon Mar 5 21:33:05 CST 2018


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/taskschd/tests/scheduler.c | 55 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c
index c60fd1d9d7..80bc1c9034 100644
--- a/dlls/taskschd/tests/scheduler.c
+++ b/dlls/taskschd/tests/scheduler.c
@@ -1304,6 +1304,8 @@ static void test_daily_trigger(ITrigger *trigger)
 static void create_action(ITaskDefinition *taskdef)
 {
     static WCHAR task1_exe[] = { 't','a','s','k','1','.','e','x','e',0 };
+    static WCHAR workdir[] = { 'w','o','r','k','d','i','r',0 };
+    static WCHAR args[] = { 'a','r','g','u','m','e','n','s',0 };
     HRESULT hr;
     IActionCollection *actions;
     IAction *action;
@@ -1311,6 +1313,9 @@ static void create_action(ITaskDefinition *taskdef)
     TASK_ACTION_TYPE type;
     BSTR path;
 
+    hr = ITaskDefinition_get_Actions(taskdef, NULL);
+    ok(hr == E_POINTER, "got %#x\n", hr);
+
     hr = ITaskDefinition_get_Actions(taskdef, &actions);
     ok(hr == S_OK, "get_Actions error %#x\n", hr);
 
@@ -1325,11 +1330,17 @@ static void create_action(ITaskDefinition *taskdef)
     ok(hr == S_OK, "get_Type error %#x\n", hr);
     ok(type == TASK_ACTION_EXEC, "got %u\n", type );
 
+    hr = IExecAction_get_Path(exec_action, NULL);
+    ok(hr == E_POINTER, "got %#x\n", hr);
+
     path = (BSTR)0xdeadbeef;
     hr = IExecAction_get_Path(exec_action, &path);
     ok(hr == S_OK, "get_Path error %#x\n", hr);
     ok(path == NULL, "path not set\n");
 
+    hr = IExecAction_put_Path(exec_action, NULL);
+    ok(hr == S_OK, "put_Path error %#x\n", hr);
+
     hr = IExecAction_put_Path(exec_action, task1_exe);
     ok(hr == S_OK, "put_Path error %#x\n", hr);
 
@@ -1337,7 +1348,49 @@ static void create_action(ITaskDefinition *taskdef)
     hr = IExecAction_get_Path(exec_action, &path);
     ok(hr == S_OK, "get_Path error %#x\n", hr);
     ok(path != NULL, "path not set\n");
-    ok(!lstrcmpW(path, task1_exe), "wrong path\n" );
+    ok(!lstrcmpW(path, task1_exe), "got %s\n", wine_dbgstr_w(path));
+    SysFreeString(path);
+
+    hr = IExecAction_get_WorkingDirectory(exec_action, NULL);
+    ok(hr == E_POINTER, "got %#x\n", hr);
+
+    path = (BSTR)0xdeadbeef;
+    hr = IExecAction_get_WorkingDirectory(exec_action, &path);
+    ok(hr == S_OK, "get_WorkingDirectory error %#x\n", hr);
+    ok(path == NULL, "workdir not set\n");
+
+    hr = IExecAction_put_WorkingDirectory(exec_action, NULL);
+    ok(hr == S_OK, "put_WorkingDirectory error %#x\n", hr);
+
+    hr = IExecAction_put_WorkingDirectory(exec_action, workdir);
+    ok(hr == S_OK, "put_WorkingDirectory error %#x\n", hr);
+
+    path = NULL;
+    hr = IExecAction_get_WorkingDirectory(exec_action, &path);
+    ok(hr == S_OK, "get_WorkingDirectory error %#x\n", hr);
+    ok(path != NULL, "workdir not set\n");
+    ok(!lstrcmpW(path, workdir), "got %s\n", wine_dbgstr_w(path));
+    SysFreeString(path);
+
+    hr = IExecAction_get_Arguments(exec_action, NULL);
+    ok(hr == E_POINTER, "got %#x\n", hr);
+
+    path = (BSTR)0xdeadbeef;
+    hr = IExecAction_get_Arguments(exec_action, &path);
+    ok(hr == S_OK, "get_Arguments error %#x\n", hr);
+    ok(path == NULL, "args not set\n");
+
+    hr = IExecAction_put_Arguments(exec_action, NULL);
+    ok(hr == S_OK, "put_Arguments error %#x\n", hr);
+
+    hr = IExecAction_put_Arguments(exec_action, args);
+    ok(hr == S_OK, "put_WorkingDirectory error %#x\n", hr);
+
+    path = NULL;
+    hr = IExecAction_get_Arguments(exec_action, &path);
+    ok(hr == S_OK, "get_Arguments error %#x\n", hr);
+    ok(path != NULL, "args not set\n");
+    ok(!lstrcmpW(path, args), "got %s\n", wine_dbgstr_w(path));
     SysFreeString(path);
 
     IExecAction_Release(exec_action);
-- 
2.16.2




More information about the wine-devel mailing list