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
a3709bad
Commit
a3709bad
authored
Mar 08, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added more connection limit options tests.
parent
9641515b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
11 deletions
+57
-11
internet.c
dlls/wininet/tests/internet.c
+57
-11
No files found.
dlls/wininet/tests/internet.c
View file @
a3709bad
...
...
@@ -159,6 +159,7 @@ static void test_InternetQueryOptionA(void)
static
const
char
useragent
[]
=
{
"Wininet Test"
};
char
*
buffer
;
int
retval
;
BOOL
res
;
hinet
=
InternetOpenA
(
useragent
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
0
);
ok
((
hinet
!=
0x0
),
"InternetOpen Failed
\n
"
);
...
...
@@ -237,20 +238,64 @@ static void test_InternetQueryOptionA(void)
ok
(
retval
==
0
,
"Got wrong return value %d
\n
"
,
retval
);
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"Got wrong error code%d
\n
"
,
err
);
InternetCloseHandle
(
hinet
);
len
=
sizeof
(
val
);
retval
=
InternetQueryOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
&
len
)
;
ok
(
retval
==
TRUE
,
"Got wrong return value %d
\n
"
,
retval
);
ok
(
len
==
sizeof
(
val
),
"got %d
\n
"
,
len
);
ok
(
val
==
2
,
"got %d
\n
"
,
val
);
val
=
0xdeadbeef
;
res
=
InternetQueryOptionA
(
hinet
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
&
len
);
ok
(
!
res
,
"InternetQueryOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_INVALID_OPERATION
,
"GetLastError() = %u
\n
"
,
GetLastError
()
);
len
=
sizeof
(
val
);
retval
=
InternetQueryOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER
,
&
val
,
&
len
);
ok
(
retval
==
TRUE
,
"Got wrong return value %d
\n
"
,
retval
);
ok
(
len
==
sizeof
(
val
),
"got %d
\n
"
,
len
);
ok
(
val
==
4
,
"got %d
\n
"
,
val
);
val
=
2
;
res
=
InternetSetOptionA
(
hinet
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
sizeof
(
val
));
ok
(
!
res
,
"InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_INVALID_OPERATION
,
"GetLastError() = %u
\n
"
,
GetLastError
());
InternetCloseHandle
(
hinet
);
}
static
void
test_max_conns
(
void
)
{
DWORD
len
,
val
;
BOOL
res
;
len
=
sizeof
(
val
);
val
=
0xdeadbeef
;
res
=
InternetQueryOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
&
len
);
ok
(
res
,
"Got wrong return value %x
\n
"
,
res
);
ok
(
len
==
sizeof
(
val
),
"got %d
\n
"
,
len
);
ok
(
val
==
2
,
"got %d
\n
"
,
val
);
len
=
sizeof
(
val
);
val
=
0xdeadbeef
;
res
=
InternetQueryOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER
,
&
val
,
&
len
);
ok
(
res
,
"Got wrong return value %x
\n
"
,
res
);
ok
(
len
==
sizeof
(
val
),
"got %d
\n
"
,
len
);
ok
(
val
==
4
,
"got %d
\n
"
,
val
);
val
=
3
;
res
=
InternetSetOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
sizeof
(
val
));
ok
(
res
,
"InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) failed: %x
\n
"
,
res
);
len
=
sizeof
(
val
);
val
=
0xdeadbeef
;
res
=
InternetQueryOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
&
len
);
ok
(
res
,
"Got wrong return value %x
\n
"
,
res
);
ok
(
len
==
sizeof
(
val
),
"got %d
\n
"
,
len
);
ok
(
val
==
3
,
"got %d
\n
"
,
val
);
val
=
0
;
res
=
InternetSetOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
sizeof
(
val
));
ok
(
!
res
,
"InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER, 0) succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_BAD_ARGUMENTS
,
"GetLastError() = %u
\n
"
,
GetLastError
());
val
=
2
;
res
=
InternetSetOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
sizeof
(
val
)
-
1
);
ok
(
!
res
,
"InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_BAD_OPTION_LENGTH
,
"GetLastError() = %u
\n
"
,
GetLastError
());
val
=
2
;
res
=
InternetSetOptionA
(
NULL
,
INTERNET_OPTION_MAX_CONNS_PER_SERVER
,
&
val
,
sizeof
(
val
)
+
1
);
ok
(
!
res
,
"InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_BAD_OPTION_LENGTH
,
"GetLastError() = %u
\n
"
,
GetLastError
());
}
static
void
test_get_cookie
(
void
)
...
...
@@ -1311,6 +1356,7 @@ START_TEST(internet)
test_Option_PerConnectionOption
();
test_Option_PerConnectionOptionA
();
test_InternetErrorDlg
();
test_max_conns
();
if
(
!
pInternetTimeFromSystemTimeA
)
win_skip
(
"skipping the InternetTime tests
\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