Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2007-11-05 07:38:40


Author: chris_kohlhoff
Date: 2007-11-05 07:38:39 EST (Mon, 05 Nov 2007)
New Revision: 40783
URL: http://svn.boost.org/trac/boost/changeset/40783

Log:
Add checks for expected failures on Windows CE.

Text files modified:
   trunk/libs/asio/test/ip/multicast.cpp | 24 ++++++++++++
   trunk/libs/asio/test/ip/unicast.cpp | 24 ++++++++++++
   trunk/libs/asio/test/socket_base.cpp | 80 +++++++++++++++++++++++++++++++++++++---
   3 files changed, 122 insertions(+), 6 deletions(-)

Modified: trunk/libs/asio/test/ip/multicast.cpp
==============================================================================
--- trunk/libs/asio/test/ip/multicast.cpp (original)
+++ trunk/libs/asio/test/ip/multicast.cpp 2007-11-05 07:38:39 EST (Mon, 05 Nov 2007)
@@ -250,28 +250,52 @@
     BOOST_CHECK(static_cast<bool>(enable_loopback1));
     BOOST_CHECK(!!enable_loopback1);
     sock_v4.set_option(enable_loopback1, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback2;
     sock_v4.get_option(enable_loopback2, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
     BOOST_CHECK(enable_loopback2.value());
     BOOST_CHECK(static_cast<bool>(enable_loopback2));
     BOOST_CHECK(!!enable_loopback2);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback3(false);
     BOOST_CHECK(!enable_loopback3.value());
     BOOST_CHECK(!static_cast<bool>(enable_loopback3));
     BOOST_CHECK(!enable_loopback3);
     sock_v4.set_option(enable_loopback3, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback4;
     sock_v4.get_option(enable_loopback4, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
     BOOST_CHECK(!enable_loopback4.value());
     BOOST_CHECK(!static_cast<bool>(enable_loopback4));
     BOOST_CHECK(!enable_loopback4);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   }
 
   if (have_v6)

Modified: trunk/libs/asio/test/ip/unicast.cpp
==============================================================================
--- trunk/libs/asio/test/ip/unicast.cpp (original)
+++ trunk/libs/asio/test/ip/unicast.cpp 2007-11-05 07:38:39 EST (Mon, 05 Nov 2007)
@@ -92,22 +92,46 @@
     ip::unicast::hops hops1(1);
     BOOST_CHECK(hops1.value() == 1);
     sock_v4.set_option(hops1, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK(!ec);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops2;
     sock_v4.get_option(hops2, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK(!ec);
     BOOST_CHECK(hops2.value() == 1);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops3(255);
     BOOST_CHECK(hops3.value() == 255);
     sock_v4.set_option(hops3, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK(!ec);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops4;
     sock_v4.get_option(hops4, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
     BOOST_CHECK(!ec);
     BOOST_CHECK(hops4.value() == 255);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   }
 
   if (have_v6)

Modified: trunk/libs/asio/test/socket_base.cpp
==============================================================================
--- trunk/libs/asio/test/socket_base.cpp (original)
+++ trunk/libs/asio/test/socket_base.cpp 2007-11-05 07:38:39 EST (Mon, 05 Nov 2007)
@@ -246,21 +246,33 @@
   BOOST_CHECK(!ec || not_root);
   BOOST_WARN_MESSAGE(!ec, "Must be root to set debug socket option");
 #else // defined(__linux__)
+# if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+# else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+# endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 #endif // defined(__linux__)
 
   socket_base::debug debug2;
   udp_sock.get_option(debug2, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#if defined(__linux__)
+# if defined(__linux__)
   BOOST_CHECK(debug2.value() || not_root);
   BOOST_CHECK(static_cast<bool>(debug2) || not_root);
   BOOST_CHECK(!!debug2 || not_root);
-#else // defined(__linux__)
+# else // defined(__linux__)
   BOOST_CHECK(debug2.value());
   BOOST_CHECK(static_cast<bool>(debug2));
   BOOST_CHECK(!!debug2);
-#endif // defined(__linux__)
+# endif // defined(__linux__)
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::debug debug3(false);
   BOOST_CHECK(!debug3.value());
@@ -270,21 +282,33 @@
 #if defined(__linux__)
   BOOST_CHECK(!ec || not_root);
 #else // defined(__linux__)
+# if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+# else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+# endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 #endif // defined(__linux__)
 
   socket_base::debug debug4;
   udp_sock.get_option(debug4, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#if defined(__linux__)
+# if defined(__linux__)
   BOOST_CHECK(!debug4.value() || not_root);
   BOOST_CHECK(!static_cast<bool>(debug4) || not_root);
   BOOST_CHECK(!debug4 || not_root);
-#else // defined(__linux__)
+# else // defined(__linux__)
   BOOST_CHECK(!debug4.value());
   BOOST_CHECK(!static_cast<bool>(debug4));
   BOOST_CHECK(!debug4);
-#endif // defined(__linux__)
+# endif // defined(__linux__)
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   // do_not_route class.
 
@@ -293,28 +317,52 @@
   BOOST_CHECK(static_cast<bool>(do_not_route1));
   BOOST_CHECK(!!do_not_route1);
   udp_sock.set_option(do_not_route1, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route2;
   udp_sock.get_option(do_not_route2, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   BOOST_CHECK(do_not_route2.value());
   BOOST_CHECK(static_cast<bool>(do_not_route2));
   BOOST_CHECK(!!do_not_route2);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route3(false);
   BOOST_CHECK(!do_not_route3.value());
   BOOST_CHECK(!static_cast<bool>(do_not_route3));
   BOOST_CHECK(!do_not_route3);
   udp_sock.set_option(do_not_route3, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route4;
   udp_sock.get_option(do_not_route4, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   BOOST_CHECK(!do_not_route4.value());
   BOOST_CHECK(!static_cast<bool>(do_not_route4));
   BOOST_CHECK(!do_not_route4);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   // keep_alive class.
 
@@ -415,22 +463,42 @@
   socket_base::receive_buffer_size receive_buffer_size1(4096);
   BOOST_CHECK(receive_buffer_size1.value() == 4096);
   tcp_sock.set_option(receive_buffer_size1, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size2;
   tcp_sock.get_option(receive_buffer_size2, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ BOOST_CHECK(!ec); // Not supported under Windows CE but can get value.
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   BOOST_CHECK(receive_buffer_size2.value() == 4096);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size3(16384);
   BOOST_CHECK(receive_buffer_size3.value() == 16384);
   tcp_sock.set_option(receive_buffer_size3, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Option is not supported under Windows CE.
+ BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ ec.value() << ", " << ec.message());
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size4;
   tcp_sock.get_option(receive_buffer_size4, ec);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ BOOST_CHECK(!ec); // Not supported under Windows CE but can get value.
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
   BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   BOOST_CHECK(receive_buffer_size4.value() == 16384);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
 
   // receive_low_watermark class.
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk