Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
38b66fff
Commit
38b66fff
authored
Sep 02, 2018
by
Benoit Eudier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor listener_test.cc
Should fail if we cannot find a port. Remove useless comment
parent
4b964416
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
tests/listener_test.cc
tests/listener_test.cc
+2
-5
No files found.
tests/listener_test.cc
View file @
38b66fff
...
@@ -109,8 +109,7 @@ TEST(listener_test, listener_bind_port_free) {
...
@@ -109,8 +109,7 @@ TEST(listener_test, listener_bind_port_free) {
if
(
port_nb
==
0
)
{
if
(
port_nb
==
0
)
{
std
::
cerr
<<
"Could not find a free port. Abord test.
\n
"
;
FAIL
()
<<
"Could not find a free port. Abord test.
\n
"
;
exit
(
1
);
}
}
Pistache
::
Port
port
(
port_nb
);
Pistache
::
Port
port
(
port_nb
);
...
@@ -129,8 +128,7 @@ TEST(listener_test, listener_bind_port_not_free_throw_runtime) {
...
@@ -129,8 +128,7 @@ TEST(listener_test, listener_bind_port_not_free_throw_runtime) {
uint16_t
port_nb
=
s
.
port
();
uint16_t
port_nb
=
s
.
port
();
if
(
port_nb
==
0
)
{
if
(
port_nb
==
0
)
{
std
::
cerr
<<
"Could not find a free port. Abord test.
\n
"
;
FAIL
()
<<
"Could not find a free port. Abord test.
\n
"
;
exit
(
1
);
}
}
Pistache
::
Port
port
(
port_nb
);
Pistache
::
Port
port
(
port_nb
);
...
@@ -146,7 +144,6 @@ TEST(listener_test, listener_bind_port_not_free_throw_runtime) {
...
@@ -146,7 +144,6 @@ TEST(listener_test, listener_bind_port_not_free_throw_runtime) {
std
::
cout
<<
err
.
what
()
<<
std
::
endl
;
std
::
cout
<<
err
.
what
()
<<
std
::
endl
;
ASSERT_STREQ
(
"Address already in use"
,
err
.
what
());
ASSERT_STREQ
(
"Address already in use"
,
err
.
what
());
}
catch
(
...
)
{
}
catch
(
...
)
{
// We are expecting a runtime error
FAIL
()
<<
"Expected std::runtime_error"
;
FAIL
()
<<
"Expected std::runtime_error"
;
}
}
}
}
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