hlink/tests: Add more tests to show a difference in string and moniker hlinks.

This commit is contained in:
Reece Dunn 2010-03-01 22:21:40 +00:00 committed by Alexandre Julliard
parent 61a56d3492
commit a2ae7a2b3d
1 changed files with 19 additions and 0 deletions

View File

@ -135,6 +135,13 @@ static void test_reference(void)
ok(r == S_OK, "failed\n"); ok(r == S_OK, "failed\n");
CoTaskMemFree(str); CoTaskMemFree(str);
r = IHlink_GetStringReference(lnk, -1, NULL, NULL);
ok(r == S_OK, "failed, r=%08x\n", r);
r = IHlink_GetStringReference(lnk, -1, NULL, &str);
ok(r == S_OK, "failed, r=%08x\n", r);
ok(str == NULL, "string should be null\n");
r = IHlink_GetStringReference(lnk, HLINKGETREF_DEFAULT, &str, NULL); r = IHlink_GetStringReference(lnk, HLINKGETREF_DEFAULT, &str, NULL);
ok(r == S_OK, "failed\n"); ok(r == S_OK, "failed\n");
ok(!lstrcmpW(str, url2), "url wrong\n"); ok(!lstrcmpW(str, url2), "url wrong\n");
@ -1212,6 +1219,18 @@ static void test_HlinkGetSetStringReference(void)
CoTaskMemFree(fnd_tgt); CoTaskMemFree(fnd_tgt);
CoTaskMemFree(fnd_loc); CoTaskMemFree(fnd_loc);
hres = IHlink_GetStringReference(link, -1, &fnd_tgt, NULL);
todo_wine ok(hres == E_FAIL, "IHlink_GetStringReference should have failed "
"with E_FAIL (0x%08x), instead: 0x%08x\n", E_FAIL, hres);
CoTaskMemFree(fnd_tgt);
hres = IHlink_GetStringReference(link, -1, NULL, NULL);
ok(hres == S_OK, "failed, hres=%08x\n", hres);
hres = IHlink_GetStringReference(link, -1, NULL, &fnd_loc);
ok(hres == S_OK, "failed, hres=%08x\n", hres);
CoTaskMemFree(fnd_loc);
hres = IHlink_GetStringReference(link, -1, &fnd_tgt, &fnd_loc); hres = IHlink_GetStringReference(link, -1, &fnd_tgt, &fnd_loc);
todo_wine ok(hres == E_FAIL, "IHlink_GetStringReference should have failed " todo_wine ok(hres == E_FAIL, "IHlink_GetStringReference should have failed "
"with E_FAIL (0x%08x), instead: 0x%08x\n", E_FAIL, hres); "with E_FAIL (0x%08x), instead: 0x%08x\n", E_FAIL, hres);