~ubuntu-branches/ubuntu/jaunty/asio/jaunty

« back to all changes in this revision

Viewing changes to src/tests/unit/ip/unicast.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Simon Richter
  • Date: 2008-05-22 00:03:36 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080522000336-82gdbtg5r3gi8ir6
Tags: 1.0.0-1
New upstream release (Closes: #461920)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
// unicast.cpp
3
3
// ~~~~~~~~~~~
4
4
//
5
 
// Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
5
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6
6
//
7
7
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
8
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
92
92
    ip::unicast::hops hops1(1);
93
93
    BOOST_CHECK(hops1.value() == 1);
94
94
    sock_v4.set_option(hops1, ec);
 
95
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
96
    // Option is not supported under Windows CE.
 
97
    BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
 
98
        ec.value() << ", " << ec.message());
 
99
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
95
100
    BOOST_CHECK(!ec);
 
101
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
96
102
 
97
103
    ip::unicast::hops hops2;
98
104
    sock_v4.get_option(hops2, ec);
 
105
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
106
    // Option is not supported under Windows CE.
 
107
    BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
 
108
        ec.value() << ", " << ec.message());
 
109
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
99
110
    BOOST_CHECK(!ec);
100
111
    BOOST_CHECK(hops2.value() == 1);
 
112
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
101
113
 
102
114
    ip::unicast::hops hops3(255);
103
115
    BOOST_CHECK(hops3.value() == 255);
104
116
    sock_v4.set_option(hops3, ec);
 
117
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
118
    // Option is not supported under Windows CE.
 
119
    BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
 
120
        ec.value() << ", " << ec.message());
 
121
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
105
122
    BOOST_CHECK(!ec);
 
123
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
106
124
 
107
125
    ip::unicast::hops hops4;
108
126
    sock_v4.get_option(hops4, ec);
 
127
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
128
    // Option is not supported under Windows CE.
 
129
    BOOST_CHECK_MESSAGE(ec == asio::error::no_protocol_option,
 
130
        ec.value() << ", " << ec.message());
 
131
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
109
132
    BOOST_CHECK(!ec);
110
133
    BOOST_CHECK(hops4.value() == 255);
 
134
#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
111
135
  }
112
136
 
113
137
  if (have_v6)