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
b02a48f0
Commit
b02a48f0
authored
Dec 28, 2018
by
hydratim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rebased onto upstream/master and modified test
parent
0d42ab85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
tests/listener_test.cc
tests/listener_test.cc
+18
-13
No files found.
tests/listener_test.cc
View file @
b02a48f0
...
...
@@ -123,19 +123,6 @@ TEST(listener_test, listener_bind_port_free) {
ASSERT_TRUE
(
true
);
}
TEST
(
listener_test
,
listener_bind_ephemeral_v6_port
)
{
Pistache
::
Port
port
(
0
);
Pistache
::
Address
address
(
Pistache
::
Ipv6
::
any
(),
port
);
Pistache
::
Tcp
::
Listener
listener
;
if
(
not
listener
.
systemSupportsIpv6
())
{
Pistache
::
Flags
<
Pistache
::
Tcp
::
Options
>
options
;
listener
.
init
(
1
,
options
);
listener
.
setHandler
(
Pistache
::
Http
::
make_handler
<
DummyHandler
>
());
listener
.
bind
(
address
);
}
ASSERT_TRUE
(
true
);
}
// Listener should not crash if an additional member is added to the listener class. This test
// is there to prevent regression for PR 303
...
...
@@ -194,6 +181,7 @@ TEST(listener_test, listener_bind_port_not_free_throw_runtime) {
}
}
// Listener should be able to bind port 0 directly to get an ephemeral port.
TEST
(
listener_test
,
listener_bind_ephemeral_port
)
{
Pistache
::
Port
port
(
0
);
...
...
@@ -206,3 +194,20 @@ TEST(listener_test, listener_bind_ephemeral_port) {
Pistache
::
Port
bound_port
=
listener
.
getPort
();
ASSERT_TRUE
(
bound_port
>
(
uint16_t
)
0
);
}
TEST
(
listener_test
,
listener_bind_ephemeral_v6_port
)
{
Pistache
::
Port
port
(
0
);
Pistache
::
Address
address
(
Pistache
::
Ipv6
::
any
(),
port
);
Pistache
::
Tcp
::
Listener
listener
;
if
(
not
listener
.
systemSupportsIpv6
())
{
Pistache
::
Flags
<
Pistache
::
Tcp
::
Options
>
options
;
listener
.
setHandler
(
Pistache
::
Http
::
make_handler
<
DummyHandler
>
());
listener
.
bind
(
address
);
Pistache
::
Port
bound_port
=
listener
.
getPort
();
ASSERT_TRUE
(
bound_port
>
(
uint16_t
)
0
);
}
ASSERT_TRUE
(
true
);
}
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