[PATCH] hlink/tests: add more tests to show a difference in string and moniker hlinks.

Reece Dunn msclrhd at googlemail.com
Mon Mar 1 16:28:31 CST 2010


Hi,

This patch improves the test coverage to show that E_FAIL returned
from hlink's GetStringReference is limited to the target out parameter
when the hlink ref is -1. This only appears to be the case for moniker
hlinks, not string hlinks, although the tests are not sufficient to
validate this.

- Reece
-------------- next part --------------
From b0fa2df6eb46bb9009daa010a04205676cdb452f Mon Sep 17 00:00:00 2001
From: Reece Dunn <msclrhd at gmail.com>
Date: Mon, 1 Mar 2010 22:21:40 +0000
Subject: [PATCH] hlink/tests: add more tests to show a difference in string and moniker hlinks.

---
 dlls/hlink/tests/hlink.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/hlink/tests/hlink.c b/dlls/hlink/tests/hlink.c
index 1802196..30b06f0 100644
--- a/dlls/hlink/tests/hlink.c
+++ b/dlls/hlink/tests/hlink.c
@@ -135,6 +135,13 @@ static void test_reference(void)
     ok(r == S_OK, "failed\n");
     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);
     ok(r == S_OK, "failed\n");
     ok(!lstrcmpW(str, url2), "url wrong\n");
@@ -1212,6 +1219,18 @@ static void test_HlinkGetSetStringReference(void)
     CoTaskMemFree(fnd_tgt);
     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);
     todo_wine ok(hres == E_FAIL, "IHlink_GetStringReference should have failed "
            "with E_FAIL (0x%08x), instead: 0x%08x\n", E_FAIL, hres);
-- 
1.6.3.3


More information about the wine-patches mailing list