Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cf371a1e
Commit
cf371a1e
authored
Jun 20, 2006
by
Andrew Talbot
Committed by
Alexandre Julliard
Jun 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Write-strings warnings fix.
parent
ef72c1d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
41 deletions
+59
-41
url.c
dlls/wininet/tests/url.c
+59
-41
No files found.
dlls/wininet/tests/url.c
View file @
cf371a1e
...
...
@@ -330,21 +330,28 @@ static void InternetCrackUrlW_test(void)
static
void
fill_url_components
(
LPURL_COMPONENTS
lpUrlComponents
)
{
lpUrlComponents
->
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
lpUrlComponents
->
lpszScheme
=
"http"
;
lpUrlComponents
->
dwSchemeLength
=
strlen
(
lpUrlComponents
->
lpszScheme
);
lpUrlComponents
->
nScheme
=
INTERNET_SCHEME_HTTP
;
lpUrlComponents
->
lpszHostName
=
"www.winehq.org"
;
lpUrlComponents
->
dwHostNameLength
=
strlen
(
lpUrlComponents
->
lpszHostName
);
lpUrlComponents
->
nPort
=
80
;
lpUrlComponents
->
lpszUserName
=
"username"
;
lpUrlComponents
->
dwUserNameLength
=
strlen
(
lpUrlComponents
->
lpszUserName
);
lpUrlComponents
->
lpszPassword
=
"password"
;
lpUrlComponents
->
dwPasswordLength
=
strlen
(
lpUrlComponents
->
lpszPassword
);
lpUrlComponents
->
lpszUrlPath
=
"/site/about"
;
lpUrlComponents
->
dwUrlPathLength
=
strlen
(
lpUrlComponents
->
lpszUrlPath
);
lpUrlComponents
->
lpszExtraInfo
=
""
;
lpUrlComponents
->
dwExtraInfoLength
=
strlen
(
lpUrlComponents
->
lpszExtraInfo
);
static
CHAR
http
[]
=
"http"
,
winehq
[]
=
"www.winehq.org"
,
username
[]
=
"username"
,
password
[]
=
"password"
,
site_about
[]
=
"/site/about"
,
empty
[]
=
""
;
lpUrlComponents
->
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
lpUrlComponents
->
lpszScheme
=
http
;
lpUrlComponents
->
dwSchemeLength
=
strlen
(
lpUrlComponents
->
lpszScheme
);
lpUrlComponents
->
nScheme
=
INTERNET_SCHEME_HTTP
;
lpUrlComponents
->
lpszHostName
=
winehq
;
lpUrlComponents
->
dwHostNameLength
=
strlen
(
lpUrlComponents
->
lpszHostName
);
lpUrlComponents
->
nPort
=
80
;
lpUrlComponents
->
lpszUserName
=
username
;
lpUrlComponents
->
dwUserNameLength
=
strlen
(
lpUrlComponents
->
lpszUserName
);
lpUrlComponents
->
lpszPassword
=
password
;
lpUrlComponents
->
dwPasswordLength
=
strlen
(
lpUrlComponents
->
lpszPassword
);
lpUrlComponents
->
lpszUrlPath
=
site_about
;
lpUrlComponents
->
dwUrlPathLength
=
strlen
(
lpUrlComponents
->
lpszUrlPath
);
lpUrlComponents
->
lpszExtraInfo
=
empty
;
lpUrlComponents
->
dwExtraInfoLength
=
strlen
(
lpUrlComponents
->
lpszExtraInfo
);
}
static
void
InternetCreateUrlA_test
(
void
)
...
...
@@ -353,6 +360,17 @@ static void InternetCreateUrlA_test(void)
LPSTR
szUrl
;
DWORD
len
=
-
1
;
BOOL
ret
;
static
CHAR
empty
[]
=
""
,
nhttp
[]
=
"nhttp"
,
http
[]
=
"http"
,
https
[]
=
"https"
,
winehq
[]
=
"www.winehq.org"
,
username
[]
=
"username"
,
password
[]
=
"password"
,
site_about
[]
=
"/site/about"
,
about
[]
=
"about"
,
blank
[]
=
"blank"
,
host
[]
=
"host"
;
/* test NULL lpUrlComponents */
ret
=
InternetCreateUrlA
(
NULL
,
0
,
NULL
,
&
len
);
...
...
@@ -462,7 +480,7 @@ static void InternetCreateUrlA_test(void)
/* valid username, empty password */
fill_url_components
(
&
urlComp
);
SetLastError
(
0xdeadbeef
);
urlComp
.
lpszPassword
=
""
;
urlComp
.
lpszPassword
=
empty
;
len
=
51
;
ret
=
InternetCreateUrlA
(
&
urlComp
,
0
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
...
...
@@ -490,7 +508,7 @@ static void InternetCreateUrlA_test(void)
*/
fill_url_components
(
&
urlComp
);
SetLastError
(
0xdeadbeef
);
urlComp
.
lpszUserName
=
""
;
urlComp
.
lpszUserName
=
empty
;
len
=
51
;
ret
=
InternetCreateUrlA
(
&
urlComp
,
0
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
...
...
@@ -515,8 +533,8 @@ static void InternetCreateUrlA_test(void)
/* empty username, empty password */
fill_url_components
(
&
urlComp
);
SetLastError
(
0xdeadbeef
);
urlComp
.
lpszUserName
=
""
;
urlComp
.
lpszPassword
=
""
;
urlComp
.
lpszUserName
=
empty
;
urlComp
.
lpszPassword
=
empty
;
len
=
51
;
ret
=
InternetCreateUrlA
(
&
urlComp
,
0
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
...
...
@@ -530,7 +548,7 @@ static void InternetCreateUrlA_test(void)
*/
fill_url_components
(
&
urlComp
);
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
urlComp
.
lpszScheme
=
"nhttp"
;
urlComp
.
lpszScheme
=
nhttp
;
urlComp
.
dwSchemeLength
=
strlen
(
urlComp
.
lpszScheme
);
len
=
strlen
(
CREATE_URL6
)
+
1
;
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
...
...
@@ -541,7 +559,7 @@ static void InternetCreateUrlA_test(void)
/* if lpszScheme != "http" or nPort != 80, display nPort */
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
urlComp
.
lpszScheme
=
"http"
;
urlComp
.
lpszScheme
=
http
;
urlComp
.
dwSchemeLength
=
strlen
(
urlComp
.
lpszScheme
);
urlComp
.
nPort
=
42
;
szUrl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
...
...
@@ -555,19 +573,19 @@ static void InternetCreateUrlA_test(void)
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"http"
;
urlComp
.
lpszScheme
=
http
;
urlComp
.
dwSchemeLength
=
0
;
urlComp
.
nScheme
=
INTERNET_SCHEME_HTTP
;
urlComp
.
lpszHostName
=
"www.winehq.org"
;
urlComp
.
lpszHostName
=
winehq
;
urlComp
.
dwHostNameLength
=
0
;
urlComp
.
nPort
=
80
;
urlComp
.
lpszUserName
=
"username"
;
urlComp
.
lpszUserName
=
username
;
urlComp
.
dwUserNameLength
=
0
;
urlComp
.
lpszPassword
=
"password"
;
urlComp
.
lpszPassword
=
password
;
urlComp
.
dwPasswordLength
=
0
;
urlComp
.
lpszUrlPath
=
"/site/about"
;
urlComp
.
lpszUrlPath
=
site_about
;
urlComp
.
dwUrlPathLength
=
0
;
urlComp
.
lpszExtraInfo
=
""
;
urlComp
.
lpszExtraInfo
=
empty
;
urlComp
.
dwExtraInfoLength
=
0
;
len
=
strlen
(
CREATE_URL1
);
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
...
...
@@ -578,19 +596,19 @@ static void InternetCreateUrlA_test(void)
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"https"
;
urlComp
.
lpszScheme
=
https
;
urlComp
.
dwSchemeLength
=
0
;
urlComp
.
nScheme
=
INTERNET_SCHEME_HTTP
;
urlComp
.
lpszHostName
=
"www.winehq.org"
;
urlComp
.
lpszHostName
=
winehq
;
urlComp
.
dwHostNameLength
=
0
;
urlComp
.
nPort
=
443
;
urlComp
.
lpszUserName
=
"username"
;
urlComp
.
lpszUserName
=
username
;
urlComp
.
dwUserNameLength
=
0
;
urlComp
.
lpszPassword
=
"password"
;
urlComp
.
lpszPassword
=
password
;
urlComp
.
dwPasswordLength
=
0
;
urlComp
.
lpszUrlPath
=
"/site/about"
;
urlComp
.
lpszUrlPath
=
site_about
;
urlComp
.
dwUrlPathLength
=
0
;
urlComp
.
lpszExtraInfo
=
""
;
urlComp
.
lpszExtraInfo
=
empty
;
urlComp
.
dwExtraInfoLength
=
0
;
len
=
strlen
(
CREATE_URL8
);
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
...
...
@@ -603,9 +621,9 @@ static void InternetCreateUrlA_test(void)
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"about"
;
urlComp
.
lpszScheme
=
about
;
urlComp
.
dwSchemeLength
=
5
;
urlComp
.
lpszUrlPath
=
"blank"
;
urlComp
.
lpszUrlPath
=
blank
;
urlComp
.
dwUrlPathLength
=
5
;
len
=
strlen
(
CREATE_URL9
);
len
++
;
/* work around bug in native wininet */
...
...
@@ -619,9 +637,9 @@ static void InternetCreateUrlA_test(void)
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"about"
;
urlComp
.
lpszHostName
=
"host"
;
urlComp
.
lpszUrlPath
=
"blank"
;
urlComp
.
lpszScheme
=
about
;
urlComp
.
lpszHostName
=
host
;
urlComp
.
lpszUrlPath
=
blank
;
len
=
strlen
(
CREATE_URL10
);
len
++
;
/* work around bug in native wininet */
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
...
...
@@ -635,7 +653,7 @@ static void InternetCreateUrlA_test(void)
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
nPort
=
8080
;
urlComp
.
lpszScheme
=
"about"
;
urlComp
.
lpszScheme
=
about
;
len
=
strlen
(
CREATE_URL11
);
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
...
...
@@ -647,10 +665,10 @@ static void InternetCreateUrlA_test(void)
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"http"
;
urlComp
.
lpszScheme
=
http
;
urlComp
.
dwSchemeLength
=
0
;
urlComp
.
nScheme
=
INTERNET_SCHEME_HTTP
;
urlComp
.
lpszHostName
=
"www.winehq.org"
;
urlComp
.
lpszHostName
=
winehq
;
urlComp
.
dwHostNameLength
=
0
;
urlComp
.
nPort
=
65535
;
len
=
strlen
(
CREATE_URL12
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment