X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FUN%2FUNDatagramSocketHandle.test.cc;h=cf2b4138e5dc903b3c1cd9b54fb0fe3d49bf7c04;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=83827e3d693ea078195524f8db03c0c4f51e4752;hpb=b7cefad1cc5f15b2af6968aa27fa4bc979bda2f3;p=senf.git diff --git a/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc b/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc index 83827e3..cf2b413 100644 --- a/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc +++ b/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc @@ -1,7 +1,9 @@ +// $Id$ +// // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum NETwork research (NET) -// David Wagner +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// David Wagner // // 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 @@ -27,7 +29,7 @@ // Custom includes #include "UNDatagramSocketHandle.hh" -#include +#include "../../../Utils/auto_unit_test.hh" #include #define prefix_ @@ -35,10 +37,33 @@ BOOST_AUTO_UNIT_TEST(unDatagramSocketHandle) { - std::string testS = "/tmp/senfTestSocket"; - senf::UNSocketAddress addr (testS) ; - //senf::UNDatagramSocketHandle init_client(addr); - senf::UNDatagramClientSocketHandle inputSocket(senf::UNSocketAddress(tests)); + std::string testString ("Hallo Welt."); + std::string socketPath (".socket-UNDatagramSocketHandle.test"); + + BOOST_CHECKPOINT( 1 ); + senf::UNSocketAddress addr (socketPath); + BOOST_CHECKPOINT( 2 ); + senf::UNDatagramClientSocketHandle inputSocket(addr); + BOOST_CHECKPOINT( 3 ); + senf::UNDatagramClientSocketHandle outputSocket; + + + BOOST_CHECKPOINT( 4 ); + outputSocket.writeto( addr, testString); + + BOOST_CHECKPOINT( 5 ); + BOOST_CHECK_EQUAL( inputSocket.read(), testString); + + + + + BOOST_CHECKPOINT( 6 ); + outputSocket.close(); + BOOST_CHECKPOINT( 7 ); + inputSocket.close(); + +// if( unlink(socketPath.c_str()) != 0) +// perror( "unlink failed"); }