Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asapo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joao Alvim Oliveira Dias De Almeida
asapo
Commits
d247e505
Commit
d247e505
authored
7 years ago
by
Carsten Patzke
Browse files
Options
Downloads
Patches
Plain Diff
Added more network integration tests
parent
22b2976c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/system_io/ip_tcp_network/ip_tcp_network.cpp
+25
-0
25 additions, 0 deletions
tests/system_io/ip_tcp_network/ip_tcp_network.cpp
with
25 additions
and
0 deletions
tests/system_io/ip_tcp_network/ip_tcp_network.cpp
+
25
−
0
View file @
d247e505
...
...
@@ -141,6 +141,25 @@ void CheckNormal(int times, size_t size) {
}
int
main
(
int
argc
,
char
*
argv
[])
{
IOErrors
err
;
std
::
cout
<<
"[META] Check if connection is refused if server is not running"
<<
std
::
endl
;
io
->
CreateAndConnectIPTCPSocket
(
kListenAddress
,
&
err
);
if
(
err
!=
IOErrors
::
kConnectionRefused
)
{
ExitIfErrIsNotOk
(
&
err
,
301
);
}
std
::
cout
<<
"[META] Check invalid address format - Missing port"
<<
std
::
endl
;
io
->
CreateAndConnectIPTCPSocket
(
"localhost"
,
&
err
);
if
(
err
!=
IOErrors
::
kInvalidAddressFormat
)
{
ExitIfErrIsNotOk
(
&
err
,
302
);
}
std
::
cout
<<
"[META] Check unknown host"
<<
std
::
endl
;
io
->
CreateAndConnectIPTCPSocket
(
"some-host-that-might-not-exists.aa:1234"
,
&
err
);
if
(
err
!=
IOErrors
::
kUnableToResolveHostname
)
{
ExitIfErrIsNotOk
(
&
err
,
303
);
}
std
::
thread
*
server_thread
=
CreateEchoServerThread
();
kThreadStarted
.
get_future
().
get
();
//Make sure that the server is started
...
...
@@ -154,5 +173,11 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"server_thread->join()"
<<
std
::
endl
;
server_thread
->
join
();
std
::
cout
<<
"[META] Check if connection is refused after server is closed"
<<
std
::
endl
;
io
->
CreateAndConnectIPTCPSocket
(
kListenAddress
,
&
err
);
if
(
err
!=
IOErrors
::
kConnectionRefused
)
{
ExitIfErrIsNotOk
(
&
err
,
304
);
}
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment