Commit 4fc1d8ee authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml/tests: Fix anchor element leaks in test helpers.

parent e7f19883
...@@ -1550,6 +1550,7 @@ static void _test_anchor_href(unsigned line, IUnknown *unk, const WCHAR *exhref) ...@@ -1550,6 +1550,7 @@ static void _test_anchor_href(unsigned line, IUnknown *unk, const WCHAR *exhref)
hres = IHTMLAnchorElement_get_href(anchor, &str); hres = IHTMLAnchorElement_get_href(anchor, &str);
ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08lx\n", hres); ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08lx\n", hres);
ok_(__FILE__,line)(!lstrcmpW(str, exhref), "href = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exhref)); ok_(__FILE__,line)(!lstrcmpW(str, exhref), "href = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exhref));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
_test_disp_value(line, unk, exhref); _test_disp_value(line, unk, exhref);
...@@ -1565,6 +1566,7 @@ static void _test_anchor_put_href(unsigned line, IUnknown *unk, const WCHAR *exh ...@@ -1565,6 +1566,7 @@ static void _test_anchor_put_href(unsigned line, IUnknown *unk, const WCHAR *exh
str = SysAllocString(exhref); str = SysAllocString(exhref);
hres = IHTMLAnchorElement_put_href(anchor, str); hres = IHTMLAnchorElement_put_href(anchor, str);
ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08lx\n", hres); ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08lx\n", hres);
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
_test_disp_value(line, unk, exhref); _test_disp_value(line, unk, exhref);
...@@ -1583,6 +1585,7 @@ static void _test_anchor_rel(unsigned line, IUnknown *unk, const WCHAR *exrel) ...@@ -1583,6 +1585,7 @@ static void _test_anchor_rel(unsigned line, IUnknown *unk, const WCHAR *exrel)
ok_(__FILE__,line)(!lstrcmpW(str, exrel), "rel = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exrel)); ok_(__FILE__,line)(!lstrcmpW(str, exrel), "rel = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exrel));
else else
ok_(__FILE__,line)(!str, "rel = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(!str, "rel = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1596,6 +1599,7 @@ static void _test_anchor_put_rel(unsigned line, IUnknown *unk, const WCHAR *exre ...@@ -1596,6 +1599,7 @@ static void _test_anchor_put_rel(unsigned line, IUnknown *unk, const WCHAR *exre
str = SysAllocString(exrel); str = SysAllocString(exrel);
hres = IHTMLAnchorElement_put_rel(anchor, str); hres = IHTMLAnchorElement_put_rel(anchor, str);
ok_(__FILE__,line)(hres == S_OK, "get_rel failed: %08lx\n", hres); ok_(__FILE__,line)(hres == S_OK, "get_rel failed: %08lx\n", hres);
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1612,6 +1616,7 @@ static void _test_anchor_get_target(unsigned line, IUnknown *unk, const WCHAR *t ...@@ -1612,6 +1616,7 @@ static void _test_anchor_get_target(unsigned line, IUnknown *unk, const WCHAR *t
ok_(__FILE__,line)(!lstrcmpW(str, target), "target = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(target)); ok_(__FILE__,line)(!lstrcmpW(str, target), "target = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(target));
else else
ok_(__FILE__,line)(str == NULL, "target = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(str == NULL, "target = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1625,6 +1630,7 @@ static void _test_anchor_put_target(unsigned line, IUnknown *unk, const WCHAR *t ...@@ -1625,6 +1630,7 @@ static void _test_anchor_put_target(unsigned line, IUnknown *unk, const WCHAR *t
str = target ? SysAllocString(target) : NULL; str = target ? SysAllocString(target) : NULL;
hres = IHTMLAnchorElement_put_target(anchor, str); hres = IHTMLAnchorElement_put_target(anchor, str);
ok_(__FILE__,line)(hres == S_OK, "put_target failed: %08lx\n", hres); ok_(__FILE__,line)(hres == S_OK, "put_target failed: %08lx\n", hres);
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1641,6 +1647,7 @@ static void _test_anchor_name(unsigned line, IUnknown *unk, const WCHAR *name) ...@@ -1641,6 +1647,7 @@ static void _test_anchor_name(unsigned line, IUnknown *unk, const WCHAR *name)
ok_(__FILE__,line)(!lstrcmpW(str, name), "name = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(name)); ok_(__FILE__,line)(!lstrcmpW(str, name), "name = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(name));
else else
ok_(__FILE__,line)(str == NULL, "name = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(str == NULL, "name = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1654,6 +1661,7 @@ static void _test_anchor_put_name(unsigned line, IUnknown *unk, const WCHAR *nam ...@@ -1654,6 +1661,7 @@ static void _test_anchor_put_name(unsigned line, IUnknown *unk, const WCHAR *nam
str = name ? SysAllocString(name) : NULL; str = name ? SysAllocString(name) : NULL;
hres = IHTMLAnchorElement_put_name(anchor, str); hres = IHTMLAnchorElement_put_name(anchor, str);
ok_(__FILE__,line)(hres == S_OK, "put_name failed: %08lx\n", hres); ok_(__FILE__,line)(hres == S_OK, "put_name failed: %08lx\n", hres);
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
_test_anchor_name(line, unk, name); _test_anchor_name(line, unk, name);
...@@ -1672,6 +1680,7 @@ static void _test_anchor_hostname(unsigned line, IUnknown *unk, const WCHAR *hos ...@@ -1672,6 +1680,7 @@ static void _test_anchor_hostname(unsigned line, IUnknown *unk, const WCHAR *hos
ok_(__FILE__,line)(!lstrcmpW(str, hostname), "hostname = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(hostname)); ok_(__FILE__,line)(!lstrcmpW(str, hostname), "hostname = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(hostname));
else else
ok_(__FILE__,line)(str == NULL, "hostname = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(str == NULL, "hostname = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1688,6 +1697,7 @@ static void _test_anchor_port(unsigned line, IUnknown *unk, const WCHAR *port) ...@@ -1688,6 +1697,7 @@ static void _test_anchor_port(unsigned line, IUnknown *unk, const WCHAR *port)
ok_(__FILE__,line)(!lstrcmpW(str, port), "port = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(port)); ok_(__FILE__,line)(!lstrcmpW(str, port), "port = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(port));
else else
ok_(__FILE__,line)(str == NULL, "port = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(str == NULL, "port = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1706,6 +1716,7 @@ static void _test_anchor_search(unsigned line, IUnknown *elem, const WCHAR *sear ...@@ -1706,6 +1716,7 @@ static void _test_anchor_search(unsigned line, IUnknown *elem, const WCHAR *sear
ok_(__FILE__,line)(!lstrcmpW(str, search), "search = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(search)); ok_(__FILE__,line)(!lstrcmpW(str, search), "search = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(search));
else else
ok_(__FILE__,line)(!str, "search = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(!str, "search = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1719,6 +1730,7 @@ static void _test_anchor_put_search(unsigned line, IUnknown *unk, const WCHAR *s ...@@ -1719,6 +1730,7 @@ static void _test_anchor_put_search(unsigned line, IUnknown *unk, const WCHAR *s
str = search ? SysAllocString(search) : NULL; str = search ? SysAllocString(search) : NULL;
hres = IHTMLAnchorElement_put_search(anchor, str); hres = IHTMLAnchorElement_put_search(anchor, str);
ok_(__FILE__,line)(hres == S_OK, "put_search failed: %08lx\n", hres); ok_(__FILE__,line)(hres == S_OK, "put_search failed: %08lx\n", hres);
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1735,6 +1747,7 @@ static void _test_anchor_hash(unsigned line, IHTMLElement *elem, const WCHAR *ex ...@@ -1735,6 +1747,7 @@ static void _test_anchor_hash(unsigned line, IHTMLElement *elem, const WCHAR *ex
ok_(__FILE__,line)(!lstrcmpW(str, exhash), "hash = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exhash)); ok_(__FILE__,line)(!lstrcmpW(str, exhash), "hash = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exhash));
else else
ok_(__FILE__,line)(!str, "hash = %s, expected NULL\n", wine_dbgstr_w(str)); ok_(__FILE__,line)(!str, "hash = %s, expected NULL\n", wine_dbgstr_w(str));
IHTMLAnchorElement_Release(anchor);
SysFreeString(str); SysFreeString(str);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment