wininet/tests: Added INTERNET_OPTION_CONNECT_TIMEOUT setting tests.
This commit is contained in:
parent
0b42100615
commit
d5913b5c45
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue