wininet/tests: Added INTERNET_OPTION_CONNECT_TIMEOUT setting tests.

This commit is contained in:
Piotr Caban 2012-05-14 13:49:49 +02:00 committed by Alexandre Julliard
parent 0b42100615
commit d5913b5c45
1 changed files with 32 additions and 0 deletions

View File

@ -228,6 +228,16 @@ static void test_InternetQueryOptionA(void)
InternetCloseHandle(hinet); 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); hinet = InternetOpenA(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0);
ok((hinet != 0x0),"InternetOpen Failed\n"); ok((hinet != 0x0),"InternetOpen Failed\n");
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -249,6 +259,28 @@ static void test_InternetQueryOptionA(void)
ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n"); ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n");
ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %u\n", GetLastError()); 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); InternetCloseHandle(hinet);
} }