Commit be2c77e6 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

wininet/tests: InternetQueryOption should return a valid value for…

wininet/tests: InternetQueryOption should return a valid value for username/password when using cached credentials. Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a28980da
......@@ -4425,6 +4425,7 @@ static void test_basic_auth_credentials_reuse(int port)
HINTERNET ses, con, req;
DWORD status, size;
BOOL ret;
char buffer[0x40];
ses = InternetOpenA( "winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 );
ok( ses != NULL, "InternetOpenA failed\n" );
......@@ -4439,6 +4440,20 @@ static void test_basic_auth_credentials_reuse(int port)
ret = HttpSendRequestA( req, NULL, 0, NULL, 0 );
ok( ret, "HttpSendRequestA failed %u\n", GetLastError() );
size = sizeof(buffer);
SetLastError(0xdeadbeef);
ret = InternetQueryOptionA(req, INTERNET_OPTION_USERNAME, buffer, &size);
ok(ret, "unexpected failure %u\n", GetLastError());
ok(!strcmp(buffer, "user"), "got %s\n", buffer);
ok(size == 4, "got %u\n", size);
size = sizeof(buffer);
SetLastError(0xdeadbeef);
ret = InternetQueryOptionA(req, INTERNET_OPTION_PASSWORD, buffer, &size);
ok(ret, "unexpected failure %u\n", GetLastError());
ok(!strcmp(buffer, "pwd"), "got %s\n", buffer);
ok(size == 3, "got %u\n", size);
status = 0xdeadbeef;
size = sizeof(status);
ret = HttpQueryInfoA( req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL );
......@@ -4462,6 +4477,20 @@ static void test_basic_auth_credentials_reuse(int port)
ret = HttpSendRequestA( req, NULL, 0, NULL, 0 );
ok( ret, "HttpSendRequestA failed %u\n", GetLastError() );
size = sizeof(buffer);
SetLastError(0xdeadbeef);
ret = InternetQueryOptionA(req, INTERNET_OPTION_USERNAME, buffer, &size);
ok(ret, "unexpected failure %u\n", GetLastError());
todo_wine ok(!strcmp(buffer, "user"), "got %s\n", buffer);
todo_wine ok(size == 4, "got %u\n", size);
size = sizeof(buffer);
SetLastError(0xdeadbeef);
ret = InternetQueryOptionA(req, INTERNET_OPTION_PASSWORD, buffer, &size);
ok(ret, "unexpected failure %u\n", GetLastError());
todo_wine ok(!strcmp(buffer, "pwd"), "got %s\n", buffer);
todo_wine ok(size == 3, "got %u\n", size);
status = 0xdeadbeef;
size = sizeof(status);
ret = HttpQueryInfoA( req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL );
......
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