Skip to content

Commit

Permalink
Only run IPV6 test if IPV6 is supported on the test system.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisjenkins75 committed Dec 31, 2018
1 parent ee2d6d6 commit 5f62bfd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/listener_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,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) {
TEST(listener_test, listener_bind_ephemeral_v4_port) {
Pistache::Port port(0);
Pistache::Address address(Pistache::Ipv4::any(), port);

Expand All @@ -197,15 +197,15 @@ TEST(listener_test, listener_bind_ephemeral_port) {


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()) {
if (listener.systemSupportsIpv6()) {
Pistache::Port port(0);
Pistache::Address address(Pistache::Ipv6::any(), port);

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);
}
Expand Down

0 comments on commit 5f62bfd

Please sign in to comment.