Commit d5913b5c authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wininet/tests: Added INTERNET_OPTION_CONNECT_TIMEOUT setting tests.

parent 0b421006
......@@ -228,6 +228,16 @@ static void test_InternetQueryOptionA(void)
InternetCloseHandle(hinet);
val = 12345;
res = InternetSetOptionA(NULL, INTERNET_OPTION_CONNECT_TIMEOUT, &val, sizeof(val));
ok(res, "InternetSetOptionA(INTERNET_OPTION_CONNECT_TIMEOUT) failed (%u)\n", GetLastError());
len = sizeof(val);
res = InternetQueryOptionA(NULL, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 12345, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
hinet = InternetOpenA(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0);
ok((hinet != 0x0),"InternetOpen Failed\n");
SetLastError(0xdeadbeef);
......@@ -249,6 +259,28 @@ static void test_InternetQueryOptionA(void)
ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n");
ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %u\n", GetLastError());
len = sizeof(val);
res = InternetQueryOptionA(hinet, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 12345, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
val = 1;
res = InternetSetOptionA(hinet, INTERNET_OPTION_CONNECT_TIMEOUT, &val, sizeof(val));
ok(res, "InternetSetOptionA(INTERNET_OPTION_CONNECT_TIMEOUT) failed (%u)\n", GetLastError());
len = sizeof(val);
res = InternetQueryOptionA(hinet, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 1, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
len = sizeof(val);
res = InternetQueryOptionA(NULL, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 12345, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
InternetCloseHandle(hinet);
}
......
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