Alistair Leslie-Hughes : wininet/tests: InternetQueryOption should return a valid value for username/password when using cached credentials.
Alexandre Julliard
julliard at winehq.org
Thu Sep 12 16:28:57 CDT 2019
Module: wine
Branch: master
Commit: be2c77e6364324326a9bb583bb9dc9c2d66c64e8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=be2c77e6364324326a9bb583bb9dc9c2d66c64e8
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu Sep 12 03:29:54 2019 +0000
wininet/tests: InternetQueryOption should return a valid value for username/password when using cached credentials.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wininet/tests/http.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index a4521a94a4..80d2aad9f4 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -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 );
More information about the wine-cvs
mailing list