switch to new MPL based Fraunhofer FOKUS Public License
[senf.git] / senf / Socket / Protocols / INet / TCPSocketHandle.test.cc
index f323450..4bb827b 100644 (file)
@@ -2,23 +2,28 @@
 //
 // Copyright (C) 2006
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
-// Competence Center NETwork research (NET), St. Augustin, GERMANY
-//     Stefan Bund <g0dil@berlios.de>
 //
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
+// The contents of this file are subject to the Fraunhofer FOKUS Public License
+// Version 1.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at 
+// http://senf.berlios.de/license.html
 //
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// The Fraunhofer FOKUS Public License Version 1.0 is based on, 
+// but modifies the Mozilla Public License Version 1.1.
+// See the full license text for the amendments.
 //
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the
-// Free Software Foundation, Inc.,
-// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// Software distributed under the License is distributed on an "AS IS" basis, 
+// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+// for the specific language governing rights and limitations under the License.
+//
+// The Original Code is Fraunhofer FOKUS code.
+//
+// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. 
+// (registered association), Hansastraße 27 c, 80686 Munich, Germany.
+// All Rights Reserved.
+//
+// Contributor(s):
+//   Stefan Bund <g0dil@berlios.de>
 
 /** \file
     \brief TCPSocketHandle unit tests */
@@ -41,9 +46,9 @@
 #include <boost/test/test_tools.hpp>
 
 #define prefix_
-///////////////////////////////cc.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
 namespace {
 
@@ -69,7 +74,7 @@ namespace {
             int n = read(sock,buffer,1024);
             if (n == 4 && strncmp(buffer,"QUIT",4) == 0)
                 break;
-            write(sock,buffer,n);
+            senf::IGNORE( write(sock,buffer,n) );
         }
 
         if (shutdown(sock, SHUT_RDWR) < 0) fail("server_v4","shutdown()");
@@ -99,7 +104,7 @@ namespace {
             int n = read(sock,buffer,1024);
             if (n == 4 && strncmp(buffer,"QUIT",4) == 0)
                 break;
-            write(sock,buffer,n);
+            senf::IGNORE( write(sock,buffer,n) );
         }
 
         if (shutdown(sock, SHUT_RDWR) < 0) fail("server_v6","shutdown()");
@@ -109,12 +114,12 @@ namespace {
 
 }
 
-BOOST_AUTO_UNIT_TEST(tcpv4ClientSocketHandle)
+SENF_AUTO_UNIT_TEST(tcpv4ClientSocketHandle)
 {
     {
         senf::TCPv4ClientSocketHandle sock;
 
-        BOOST_CHECK_THROW( sock.connect(senf::INet4SocketAddress(localhost4str(0))), 
+        BOOST_CHECK_THROW( sock.connect(senf::INet4SocketAddress(localhost4str(0))),
                            senf::SystemException );
     }
 
@@ -122,8 +127,8 @@ BOOST_AUTO_UNIT_TEST(tcpv4ClientSocketHandle)
         alarm(10);
         start(server_v4);
         senf::TCPv4ClientSocketHandle sock;
-        SENF_CHECK_NO_THROW( sock.bind(senf::INet4SocketAddress(localhost4str(1)) );
-                             SENF_CHECK_NO_THROW( sock.connect(senf::INet4SocketAddress(localhost4str(0)))) );
+        SENF_CHECK_NO_THROW( sock.bind(senf::INet4SocketAddress(localhost4str(1))) );
+        SENF_CHECK_NO_THROW( sock.connect(senf::INet4SocketAddress(localhost4str(0))) );
         BOOST_CHECK( sock.peer() == senf::INet4SocketAddress(localhost4str(0)) );
         BOOST_CHECK( sock.local() == senf::INet4SocketAddress(localhost4str(1)) );
         BOOST_CHECK( sock.blocking() );
@@ -180,12 +185,12 @@ BOOST_AUTO_UNIT_TEST(tcpv4ClientSocketHandle)
     }
 }
 
-BOOST_AUTO_UNIT_TEST(tcpv6ClientSocketHandle)
+SENF_AUTO_UNIT_TEST(tcpv6ClientSocketHandle)
 {
     {
         senf::TCPv6ClientSocketHandle sock;
 
-        BOOST_CHECK_THROW( sock.connect(senf::INet6SocketAddress(localhost6str(0))), 
+        BOOST_CHECK_THROW( sock.connect(senf::INet6SocketAddress(localhost6str(0))),
                            senf::SystemException );
     }
 
@@ -239,7 +244,7 @@ BOOST_AUTO_UNIT_TEST(tcpv6ClientSocketHandle)
     }
 }
 
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
 namespace {
 
@@ -260,7 +265,7 @@ namespace {
             int n = read(sock,buffer,1024);
             if (n == 4 && strncmp(buffer,"QUIT",4) == 0)
                 break;
-            write(sock,buffer,n);
+            senf::IGNORE( write(sock,buffer,n) );
         }
 
         if (shutdown(sock, SHUT_RDWR) < 0) fail("client_v4","shutdown()");
@@ -284,7 +289,7 @@ namespace {
             int n = read(sock,buffer,1024);
             if (n == 4 && strncmp(buffer,"QUIT",4) == 0)
                 break;
-            write(sock,buffer,n);
+            senf::IGNORE( write(sock,buffer,n) );
         }
 
         if (shutdown(sock, SHUT_RDWR) < 0) fail("client_v6","shutdown()");
@@ -293,7 +298,7 @@ namespace {
 
 }
 
-BOOST_AUTO_UNIT_TEST(tcpv4ServerSocketHandle)
+SENF_AUTO_UNIT_TEST(tcpv4ServerSocketHandle)
 {
     try {
         alarm(10);
@@ -319,7 +324,7 @@ BOOST_AUTO_UNIT_TEST(tcpv4ServerSocketHandle)
     }
 }
 
-BOOST_AUTO_UNIT_TEST(tcpv6ServerSocketHandle)
+SENF_AUTO_UNIT_TEST(tcpv6ServerSocketHandle)
 {
     try {
         alarm(10);
@@ -345,7 +350,7 @@ BOOST_AUTO_UNIT_TEST(tcpv6ServerSocketHandle)
     }
 }
 
-///////////////////////////////cc.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 #undef prefix_
 
 \f