Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
00b7b29c
Commit
00b7b29c
authored
Feb 12, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Feb 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/ftp.c: Add tests to show the order of parameter checking.
parent
b6d8b27b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
ftp.c
dlls/wininet/tests/ftp.c
+25
-9
No files found.
dlls/wininet/tests/ftp.c
View file @
00b7b29c
...
@@ -237,21 +237,29 @@ static void test_getfile(void)
...
@@ -237,21 +237,29 @@ static void test_getfile(void)
BOOL
bRet
;
BOOL
bRet
;
HINTERNET
hInternet
,
hFtp
,
hConnect
;
HINTERNET
hInternet
,
hFtp
,
hConnect
;
/* Invalid internet handle, the other is a valid parameter */
/* The order of checking is:
*
* All parameters except 'session handle' and 'condition flags'
* Session handle
* Session handle type
* Condition flags
*/
/* Test to show existence of local file is tested first (together with 'remote file') */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
bRet
=
FtpGetFileA
(
NULL
,
"welcome.msg"
,
"should_be_non_existing_deadbeef"
,
FALSE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
bRet
=
FtpGetFileA
(
NULL
,
NULL
,
"should_be_non_existing_deadbeef"
,
FALSE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
todo_wine
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_
HANDLE
,
ok
(
GetLastError
()
==
ERROR_INVALID_
PARAMETER
,
"Expected ERROR_INVALID_
HANDLE
, got %d
\n
"
,
GetLastError
());
"Expected ERROR_INVALID_
PARAMETER
, got %d
\n
"
,
GetLastError
());
/* Test to show
that FtpGetFileA checks the parameters before the handle
*/
/* Test to show
session handle is checked before 'condition flags'
*/
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
bRet
=
FtpGetFileA
(
NULL
,
NULL
,
NULL
,
FALSE
,
0
,
5
,
0
);
bRet
=
FtpGetFileA
(
NULL
,
"welcome.msg"
,
"should_be_non_existing_deadbeef"
,
FALSE
,
FILE_ATTRIBUTE_NORMAL
,
5
,
0
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
todo_wine
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_
PARAMETER
,
ok
(
GetLastError
()
==
ERROR_INVALID_
HANDLE
,
"Expected ERROR_INVALID_
PARAMETER
, got %d
\n
"
,
GetLastError
());
"Expected ERROR_INVALID_
HANDLE
, got %d
\n
"
,
GetLastError
());
hInternet
=
InternetOpen
(
NULL
,
0
,
NULL
,
NULL
,
0
);
hInternet
=
InternetOpen
(
NULL
,
0
,
NULL
,
NULL
,
0
);
hFtp
=
InternetConnect
(
hInternet
,
"ftp.winehq.org"
,
INTERNET_DEFAULT_FTP_PORT
,
"anonymous"
,
"IEUser@"
,
INTERNET_SERVICE_FTP
,
0
,
0
);
hFtp
=
InternetConnect
(
hInternet
,
"ftp.winehq.org"
,
INTERNET_DEFAULT_FTP_PORT
,
"anonymous"
,
"IEUser@"
,
INTERNET_SERVICE_FTP
,
0
,
0
);
...
@@ -378,7 +386,15 @@ static void test_getfile(void)
...
@@ -378,7 +386,15 @@ static void test_getfile(void)
hConnect
=
InternetConnect
(
hInternet
,
"www.winehq.org"
,
INTERNET_DEFAULT_HTTP_PORT
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
hConnect
=
InternetConnect
(
hInternet
,
"www.winehq.org"
,
INTERNET_DEFAULT_HTTP_PORT
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
/* One small test to show that handle type is checked before parameters */
/* Test to show existence of local file is tested before 'session handle type' */
SetLastError
(
0xdeadbeef
);
bRet
=
FtpGetFileA
(
hConnect
,
NULL
,
"should_be_non_existing_deadbeef"
,
FALSE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* Test to show that 'session handle type' is checked before 'condition flags' */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
bRet
=
FtpGetFileA
(
hConnect
,
"welcome.msg"
,
"should_be_non_existing_deadbeef"
,
FALSE
,
FILE_ATTRIBUTE_NORMAL
,
5
,
0
);
bRet
=
FtpGetFileA
(
hConnect
,
"welcome.msg"
,
"should_be_non_existing_deadbeef"
,
FALSE
,
FILE_ATTRIBUTE_NORMAL
,
5
,
0
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
...
...
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