diff options
Diffstat (limited to 'libs/asio/test/ip/multicast.cpp')
-rw-r--r-- | libs/asio/test/ip/multicast.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/libs/asio/test/ip/multicast.cpp b/libs/asio/test/ip/multicast.cpp index b5be1c276..faa894499 100644 --- a/libs/asio/test/ip/multicast.cpp +++ b/libs/asio/test/ip/multicast.cpp @@ -2,7 +2,7 @@ // multicast.cpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -169,30 +169,34 @@ void test() { ip::multicast::join_group join_group(multicast_address_v4); sock_v4.set_option(join_group, ec); - BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); + BOOST_ASIO_CHECK_MESSAGE(!ec || ec == error::no_such_device, + ec.value() << ", " << ec.message()); + + if (!ec) + { + // leave_group class. + + ip::multicast::leave_group leave_group(multicast_address_v4); + sock_v4.set_option(leave_group, ec); + BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); + } } if (have_v6) { ip::multicast::join_group join_group(multicast_address_v6); sock_v6.set_option(join_group, ec); - BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); - } + BOOST_ASIO_CHECK_MESSAGE(!ec || ec == error::no_such_device, + ec.value() << ", " << ec.message()); - // leave_group class. + if (!ec) + { + // leave_group class. - if (have_v4) - { - ip::multicast::leave_group leave_group(multicast_address_v4); - sock_v4.set_option(leave_group, ec); - BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); - } - - if (have_v6) - { - ip::multicast::leave_group leave_group(multicast_address_v6); - sock_v6.set_option(leave_group, ec); - BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); + ip::multicast::leave_group leave_group(multicast_address_v6); + sock_v6.set_option(leave_group, ec); + BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message()); + } } // outbound_interface class. |