From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47152 --- programs/schtasks/schtasks.c | 27 +++++++++++++++++++++++++-- programs/schtasks/tests/schtasks.c | 26 +++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/programs/schtasks/schtasks.c b/programs/schtasks/schtasks.c index bb52e7e7bc0..a5be5ce3ec4 100644 --- a/programs/schtasks/schtasks.c +++ b/programs/schtasks/schtasks.c @@ -244,7 +244,6 @@ static int create_command(int argc, WCHAR *argv[]) return E_FAIL; }
- FIXME("Unsupported /tr option %s\n", debugstr_w(argv[1])); task_run = argv[1]; tr_mode = TRUE; argc -= 2; @@ -260,7 +259,6 @@ static int create_command(int argc, WCHAR *argv[]) return E_FAIL; }
- FIXME("Unsupported /sc option %s\n", debugstr_w(argv[1])); schedule = argv[1]; tr_mode = TRUE; argc -= 2; @@ -340,12 +338,37 @@ static int create_command(int argc, WCHAR *argv[]) return E_FAIL; }
+ FIXME("Unsupported /tr option %s\n", wine_dbgstr_w(task_run)); if (!schedule) { ERR("Missing /sc argument\n"); return E_FAIL; + } else if (!wcsicmp(schedule, L"minute")){ + FIXME("Unsupported /sc minute\n"); + } else if (!wcsicmp(schedule, L"hourly")){ + FIXME("Unsupported /sc hourly\n"); + } else if (!wcsicmp(schedule, L"daily")){ + FIXME("Unsupported /sc daily\n"); + } else if (!wcsicmp(schedule, L"weekly")){ + FIXME("Unsupported /sc weekly\n"); + } else if (!wcsicmp(schedule, L"monthly")){ + FIXME("Unsupported /sc monthly\n"); + } else if (!wcsicmp(schedule, L"once")){ + FIXME("Unsupported /sc once\n"); + } else if (!wcsicmp(schedule, L"onstart")){ + FIXME("Unsupported /sc onstart\n"); + } else if (!wcsicmp(schedule, L"onlogon")){ + FIXME("Unsupported /sc onlogon\n"); + } else if (!wcsicmp(schedule, L"onidle")){ + FIXME("Unsupported /sc onidle\n"); + } else if (!wcsicmp(schedule, L"onevent")){ + FIXME("Unsupported /sc onevent\n"); + } else { + ERR("Invalid schedule type %s\n", debugstr_w(schedule)); + return E_FAIL; } return 0; } + return E_FAIL; }
diff --git a/programs/schtasks/tests/schtasks.c b/programs/schtasks/tests/schtasks.c index 248dd1b8c1e..f92333af9f2 100644 --- a/programs/schtasks/tests/schtasks.c +++ b/programs/schtasks/tests/schtasks.c @@ -254,8 +254,16 @@ START_TEST(schtasks)
create_file("test.xml", xml_a);
- r = run_command("schtasks /create /xml test.xml /tn wine\winetest"); - ok(r == 0, "r = %lu\n", r); + create_file("empty.xml", ""); + + r = run_command("schtasks /create /xml test.xml"); + ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */ + + r = run_command("schtasks /create /xml test.xml /tn"); + ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */ + + r = run_command("schtasks /create /xml /tn wine\winetest"); + ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */
r = run_command("schtasks /create /xml test.xml /tn wine\winetest /tn"); ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */ @@ -269,6 +277,12 @@ START_TEST(schtasks) r = run_command("schtasks /create /xml test.xml /tn wine\winetest /xml empty.xml"); ok(r == E_FAIL, "r = %lx\n", r); /* duplicate arguments */
+ r = run_command("schtasks /create /xml test.xml /tn wine\winetest"); + ok(r == 0, "r = %lu\n", r); + + r = run_command("schtasks /create /xml empty.xml /tn wine\winetest"); + ok(r == 1, "r = %lu\n", r); + r = run_command("schtasks /create /xml test.xml /tn wine\winetest /tr c:\windows\hh.exe"); ok(r == E_FAIL, "r = %lu\n", r);
@@ -290,6 +304,9 @@ START_TEST(schtasks) r = run_command("schtasks /create /tn wine\winetest"); ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */
+ r = run_command("schtasks /create /tn"); + ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */ + r = run_command("schtasks /create /tn wine\winetest /tr c:\windows\hh.exe"); ok(r == E_FAIL, "r = %lx\n", r); /* missing arguments */
@@ -297,11 +314,14 @@ START_TEST(schtasks) ok(r == E_FAIL, "r = %lx\n", r); /* invalid schedule */
r = run_command("schtasks /create /tn wine\winetest /tr c:\windows\hh.exe /sc daily"); - todo_wine ok(r == 0, "r = %lx\n", r); /* daily schedule */ + ok(r == 0, "r = %lx\n", r); /* daily schedule */
r = run_command("schtasks /DELETE /f /tn wine\winetest"); todo_wine ok(r == 0, "r = %lu\n", r);
+ r = DeleteFileA("empty.xml"); + ok(r, "DeleteFileA failed: %lu\n", GetLastError()); + r = DeleteFileA("test.xml"); ok(r, "DeleteFileA failed: %lu\n", GetLastError());