NEW FILE HEADER / COPYRIGHT FORMAT
[senf.git] / Socket / Protocols / UN / UNDatagramSocketHandle.test.cc
index 69e743e..222841e 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright (C) 2007 
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
 // Kompetenzzentrum NETwork research (NET)
-//     David Wagner <david.wagner@fokus.fraunhofer.de>
+//     David Wagner <dw6@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
 
 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");
+
+    senf::UNSocketAddress addr (socketPath);
+    senf::UNDatagramClientSocketHandle inputSocket(addr);
+    senf::UNDatagramClientSocketHandle outputSocket;
+
+
+    outputSocket.writeto( addr, testString);
+
+    BOOST_CHECK_EQUAL( inputSocket.read(), testString);
+
+      
+    
+
+    outputSocket.close();
+    inputSocket.close();
+
+//    if( unlink(socketPath.c_str()) != 0)
+//        perror( "unlink failed");
 }