From 35bd57ec5e62a984dd4223551eaa0714c06f7722 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 27 Mar 2018 18:20:19 +0200 Subject: [PATCH] msxml3/tests: Added invalid host XHR tests. Signed-off-by: Jacek Caban Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/msxml3/tests/httpreq.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c index 5149222c7fb..f20f18fb63c 100644 --- a/dlls/msxml3/tests/httpreq.c +++ b/dlls/msxml3/tests/httpreq.c @@ -1786,6 +1786,18 @@ static void test_XMLHTTP(void) ok(str && *str, "Expected response headers.\n"); SysFreeString(str); + IXMLHttpRequest_Release(xhr); + + /* invalid host */ + xhr = create_xhr(); + + test_open(xhr, "GET", "http://invalid.host.test.winehq.org/test/path", S_OK); + + V_VT(&varbody) = VT_EMPTY; + hr = IXMLHttpRequest_send(xhr, varbody); + todo_wine + ok(hr == INET_E_RESOURCE_NOT_FOUND, "send to invalid host returned %#x.\n", hr); + IXMLHttpRequest_Release(xhr); free_bstrs(); } @@ -1818,6 +1830,18 @@ static void test_server_xhr(void) ok(!strcmp_wa(response, xmltestbodyA), "got %s\n", wine_dbgstr_w(response)); SysFreeString(response); + IServerXMLHTTPRequest_Release(xhr); + + /* invalid host */ + xhr = create_server_xhr(); + + test_server_open(xhr, "GET", "http://invalid.host.test.winehq.org/test/path", S_OK); + + V_VT(&body) = VT_EMPTY; + hr = IServerXMLHTTPRequest_send(xhr, body); + todo_wine + ok(hr == WININET_E_NAME_NOT_RESOLVED, "send to invalid host returned %#x.\n", hr); + IServerXMLHTTPRequest_Release(xhr); free_bstrs(); }