From: jmo Date: Tue, 13 Nov 2007 10:11:41 +0000 (+0000) Subject: doing a unit test in a more sensible way :) X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=d9803702b36401706937c8b0eebc2a947ecad907;p=senf.git doing a unit test in a more sensible way :) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@508 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc b/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc index 33a0e1f..6eb4460 100644 --- a/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc +++ b/Socket/Protocols/UN/UNDatagramSocketHandle.test.cc @@ -35,26 +35,23 @@ BOOST_AUTO_UNIT_TEST(unDatagramSocketHandle) { - std::string hallo = "Hallo Welt."; - std::string testS = "/tmp/senfTestSocket"; - - if( unlink(testS.c_str()) != 0) - perror( "unlink failed"); + std::string hallo = "Hallo Welt."; + std::string testS = ".socket-UNDatagramSocketHandle.test"; + + unlink(testS.c_str()); - senf::UNSocketAddress addr (testS) ; - senf::UNDatagramClientSocketHandle inputSocket(addr); - senf::UNDatagramClientSocketHandle outputSocket; - - outputSocket.writeto( addr, hallo); - - BOOST_CHECK_EQUAL( inputSocket.read(), hallo); - outputSocket.close(); - inputSocket.close(); - - printf( "dasklfhsdlkfjsdkl\n"); - printf( "%s\n", testS.c_str()); - if( unlink(testS.c_str()) != 0) - perror( "unlink failed"); + senf::UNSocketAddress addr (testS) ; + senf::UNDatagramClientSocketHandle inputSocket(addr); + senf::UNDatagramClientSocketHandle outputSocket; + + outputSocket.writeto( addr, hallo); + + BOOST_CHECK_EQUAL( inputSocket.read(), hallo); + outputSocket.close(); + inputSocket.close(); + + if( unlink(testS.c_str()) != 0) + perror( "unlink failed"); }