Commit 858caa9a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Merge GetLastError() test into other request tests.

parent c3566b08
......@@ -2213,7 +2213,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
static void test_basic_request(int port, const char *verb, const char *url)
{
HINTERNET hi, hc, hr;
DWORD r, count;
DWORD r, count, error;
char buffer[0x100];
hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
......@@ -2225,7 +2225,10 @@ static void test_basic_request(int port, const char *verb, const char *url)
hr = HttpOpenRequestA(hc, verb, url, NULL, NULL, NULL, 0, 0);
ok(hr != NULL, "HttpOpenRequest failed\n");
SetLastError(0xdeadbeef);
r = HttpSendRequestA(hr, NULL, 0, NULL, 0);
error = GetLastError();
ok(error == ERROR_SUCCESS || broken(error != ERROR_SUCCESS), "expected ERROR_SUCCESS, got %u\n", error);
ok(r, "HttpSendRequest failed\n");
count = 0;
......@@ -2241,32 +2244,6 @@ static void test_basic_request(int port, const char *verb, const char *url)
InternetCloseHandle(hi);
}
static void test_last_error(int port)
{
HINTERNET hi, hc, hr;
DWORD error;
BOOL r;
hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
ok(hi != NULL, "open failed\n");
hc = InternetConnectA(hi, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
ok(hc != NULL, "connect failed\n");
hr = HttpOpenRequestA(hc, NULL, "/test1", NULL, NULL, NULL, 0, 0);
ok(hr != NULL, "HttpOpenRequest failed\n");
SetLastError(0xdeadbeef);
r = HttpSendRequestA(hr, NULL, 0, NULL, 0);
error = GetLastError();
ok(r, "HttpSendRequest failed\n");
ok(error == ERROR_SUCCESS || broken(error != ERROR_SUCCESS), "expected ERROR_SUCCESS, got %u\n", error);
InternetCloseHandle(hr);
InternetCloseHandle(hc);
InternetCloseHandle(hi);
}
static void test_proxy_indirect(int port)
{
HINTERNET hi, hc, hr;
......@@ -3994,7 +3971,6 @@ static void test_http_connection(void)
test_response_without_headers(si.port);
test_HttpQueryInfo(si.port);
test_HttpSendRequestW(si.port);
test_last_error(si.port);
test_options(si.port);
test_no_content(si.port);
test_conn_close(si.port);
......
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