Packets: Add StringParser ostream operation
[senf.git] / Utils / Daemon / Daemon.test.cc
index f3dfc1e..b62d7ba 100644 (file)
@@ -21,7 +21,7 @@
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 /** \file
-    \brief Daemon.test unit tests */
+    \brief Daemon unit tests */
 
 //#include "Daemon.test.hh"
 //#include "Daemon.test.ih"
 #include <fstream>
 #include <boost/filesystem/operations.hpp>
 #include "Daemon.hh"
-#include "../Utils/Exception.hh"
-#include "../Utils/Backtrace.hh"
-#include "../Scheduler/Scheduler.hh"
+#include "../Exception.hh"
+#include "../Backtrace.hh"
+#include "../../Scheduler/Scheduler.hh"
 
-#include "../Utils/auto_unit_test.hh"
+#include "../auto_unit_test.hh"
 #include <boost/test/test_tools.hpp>
 
 #define prefix_
@@ -65,11 +65,12 @@ namespace {
 
         void init() { 
             std::cout << "Running init()" << std::endl; 
+            std::cerr << "(stderr)" << std::endl;
         }
 
         void run() {
             std::cout << "Running run()" << std::endl; 
-            delay(1500);
+            delay(2000);
         }
     };
 
@@ -141,7 +142,7 @@ BOOST_AUTO_UNIT_TEST(testDaemon)
             ::kill(pid, SIGHUP);
     }
 
-    delay(1000);
+    delay(2000);
     BOOST_CHECK( ! boost::filesystem::exists("testDaemon.pid") );
     BOOST_CHECK( boost::filesystem::exists("testDaemon.log") );
     BOOST_CHECK( boost::filesystem::exists("testDaemon.log.1") );
@@ -149,9 +150,9 @@ BOOST_AUTO_UNIT_TEST(testDaemon)
     std::ifstream log ("testDaemon.log.1");
     std::stringstream data;
     data << log.rdbuf();
-    BOOST_CHECK_EQUAL( data.str(), "Running init()\nRunning run()\n" );
-    BOOST_CHECK_NO_THROW( boost::filesystem::remove("testDaemon.log") );
-    BOOST_CHECK_NO_THROW( boost::filesystem::remove("testDaemon.log.1") );
+    BOOST_CHECK_EQUAL( data.str(), "Running init()\n(stderr)\nRunning run()\n" );
+    SENF_CHECK_NO_THROW( boost::filesystem::remove("testDaemon.log") );
+    SENF_CHECK_NO_THROW( boost::filesystem::remove("testDaemon.log.1") );
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////