mstask/tests: Conformance test for (Set|Get)Comment.
This commit is contained in:
parent
cd8ac27304
commit
7cca21426a
|
@ -300,11 +300,82 @@ static void test_SetParameters_GetParameters(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_SetComment_GetComment(void)
|
||||||
|
{
|
||||||
|
BOOL setup;
|
||||||
|
HRESULT hres;
|
||||||
|
LPWSTR comment;
|
||||||
|
const WCHAR comment_a[] = {'C','o','m','m','e','n','t','.', 0};
|
||||||
|
const WCHAR comment_b[] = {'L','o','n','g','e','r',' ',
|
||||||
|
'c','o','m','m','e','n','t','.', 0};
|
||||||
|
|
||||||
|
setup = setup_task();
|
||||||
|
ok(setup, "Failed to setup test_task\n");
|
||||||
|
if (!setup)
|
||||||
|
{
|
||||||
|
skip("Failed to create task. Skipping tests.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get comment before setting it*/
|
||||||
|
hres = ITask_GetComment(test_task, &comment);
|
||||||
|
todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres);
|
||||||
|
if (hres == S_OK)
|
||||||
|
{
|
||||||
|
todo_wine ok(!lstrcmpW(comment, empty),
|
||||||
|
"Got %s, expected empty string\n", dbgstr_w(comment));
|
||||||
|
CoTaskMemFree(comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set comment to a simple string */
|
||||||
|
hres = ITask_SetComment(test_task, comment_a);
|
||||||
|
todo_wine ok(hres == S_OK, "Failed setting comment %s: %08x\n",
|
||||||
|
dbgstr_w(comment_a), hres);
|
||||||
|
hres = ITask_GetComment(test_task, &comment);
|
||||||
|
todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres);
|
||||||
|
if (hres == S_OK)
|
||||||
|
{
|
||||||
|
todo_wine ok(!lstrcmpW(comment, comment_a), "Got %s, expected %s\n",
|
||||||
|
dbgstr_w(comment), dbgstr_w(comment_a));
|
||||||
|
CoTaskMemFree(comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Update comment to a different simple string */
|
||||||
|
hres = ITask_SetComment(test_task, comment_b);
|
||||||
|
todo_wine ok(hres == S_OK, "Failed setting comment %s: %08x\n",
|
||||||
|
dbgstr_w(comment_b), hres);
|
||||||
|
hres = ITask_GetComment(test_task, &comment);
|
||||||
|
todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres);
|
||||||
|
if (hres == S_OK)
|
||||||
|
{
|
||||||
|
todo_wine ok(!lstrcmpW(comment, comment_b), "Got %s, expected %s\n",
|
||||||
|
dbgstr_w(comment), dbgstr_w(comment_b));
|
||||||
|
CoTaskMemFree(comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Clear comment */
|
||||||
|
hres = ITask_SetComment(test_task, empty);
|
||||||
|
todo_wine ok(hres == S_OK, "Failed setting comment %s: %08x\n",
|
||||||
|
dbgstr_w(empty), hres);
|
||||||
|
hres = ITask_GetComment(test_task, &comment);
|
||||||
|
todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres);
|
||||||
|
if (hres == S_OK)
|
||||||
|
{
|
||||||
|
todo_wine ok(!lstrcmpW(comment, empty),
|
||||||
|
"Got %s, expected empty string\n", dbgstr_w(comment));
|
||||||
|
CoTaskMemFree(comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup_task();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(task)
|
START_TEST(task)
|
||||||
{
|
{
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
test_SetApplicationName_GetApplicationName();
|
test_SetApplicationName_GetApplicationName();
|
||||||
test_CreateTrigger();
|
test_CreateTrigger();
|
||||||
test_SetParameters_GetParameters();
|
test_SetParameters_GetParameters();
|
||||||
|
test_SetComment_GetComment();
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue