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
5a712037
Commit
5a712037
authored
Jan 27, 2010
by
Matijn Woudt
Committed by
Alexandre Julliard
Jan 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp/tests: Add tests for WinHttpSetTimeouts.
parent
6ae7fe65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
0 deletions
+108
-0
winhttp.c
dlls/winhttp/tests/winhttp.c
+108
-0
No files found.
dlls/winhttp/tests/winhttp.c
View file @
5a712037
...
...
@@ -1031,6 +1031,113 @@ static void test_set_default_proxy_config(void)
GetLastError
());
}
static
void
test_Timeouts
(
void
)
{
BOOL
ret
;
HINTERNET
ses
,
req
,
con
;
static
const
WCHAR
codeweavers
[]
=
{
'c'
,
'o'
,
'd'
,
'e'
,
'w'
,
'e'
,
'a'
,
'v'
,
'e'
,
'r'
,
's'
,
'.'
,
'c'
,
'o'
,
'm'
,
0
};
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
ses
,
-
2
,
0
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
ses
,
0
,
-
2
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
ses
,
0
,
0
,
-
2
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
ses
,
0
,
0
,
0
,
-
2
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
ses
,
-
1
,
-
1
,
-
1
,
-
1
);
todo_wine
ok
(
ret
,
"%u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
ses
,
0
,
0
,
0
,
0
);
todo_wine
ok
(
ret
,
"%u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
codeweavers
,
0
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
con
,
-
2
,
0
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
con
,
0
,
-
2
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
con
,
0
,
0
,
-
2
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
con
,
0
,
0
,
0
,
-
2
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
con
,
-
1
,
-
1
,
-
1
,
-
1
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_INCORRECT_HANDLE_TYPE
,
"expected ERROR_WINHTTP_INVALID_TYPE, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
con
,
0
,
0
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_WINHTTP_INCORRECT_HANDLE_TYPE
,
"expected ERROR_WINHTTP_INVALID_TYPE, got %u
\n
"
,
GetLastError
());
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
req
,
-
2
,
0
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
req
,
0
,
-
2
,
0
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
req
,
0
,
0
,
-
2
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
req
,
0
,
0
,
0
,
-
2
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
req
,
-
1
,
-
1
,
-
1
,
-
1
);
ok
(
ret
,
"%u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpSetTimeouts
(
req
,
0
,
0
,
0
,
0
);
ok
(
ret
,
"%u
\n
"
,
GetLastError
());
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
}
START_TEST
(
winhttp
)
{
test_OpenRequest
();
...
...
@@ -1043,4 +1150,5 @@ START_TEST (winhttp)
test_QueryOption
();
test_set_default_proxy_config
();
test_empty_headers_param
();
test_Timeouts
();
}
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