removed some useless spaces; not very important, I know :)
[senf.git] / PPI / IntervalTimer.test.cc
index b3984e1..3f5d92b 100644 (file)
@@ -1,8 +1,8 @@
 // $Id$
 //
-// Copyright (C) 2007 
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
+// Copyright (C) 2007
+// 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
@@ -31,7 +31,7 @@
 #include "Module.hh"
 #include "Setup.hh"
 
-#include <boost/test/auto_unit_test.hpp>
+#include "../Utils/auto_unit_test.hh"
 #include <boost/test/test_tools.hpp>
 
 #define prefix_
@@ -41,7 +41,7 @@ namespace module = senf::ppi::module;
 namespace ppi = senf::ppi;
 
 namespace {
-    
+
     class TimerTest : public module::Module
     {
         SENF_PPI_MODULE(TimerTest);
@@ -57,15 +57,15 @@ namespace {
 
     public:
         TimerTest(senf::ClockService::clock_type d_, unsigned n_)
-        :   timer ( senf::ClockService::milliseconds(d_) ), 
-            n     ( n_ ) 
+        :   timer ( senf::ClockService::milliseconds(d_) ),
+            n     ( n_ )
         {
-            registerEvent( &TimerTest::tick, timer );
+            registerEvent( timer, &TimerTest::tick );
         }
     };
 
-    bool is_close_clock(senf::ClockService::clock_type a, senf::ClockService::clock_type b, 
-                        unsigned long delta = 50000000ul)
+    bool is_close_clock(senf::ClockService::clock_type a, senf::ClockService::clock_type b,
+                        unsigned long delta = senf::ClockService::milliseconds(100))
     {
         return (a<b ? b-a : a-b ) < delta;
     }
@@ -76,7 +76,7 @@ BOOST_AUTO_UNIT_TEST(intervalTimer)
     TimerTest timer (100,4);
     senf::ClockService::clock_type start (senf::ClockService::now());
     senf::ppi::run();
-    BOOST_CHECK_PREDICATE( is_close_clock, 
+    BOOST_CHECK_PREDICATE( is_close_clock,
                            (senf::ClockService::now())
                            (start+senf::ClockService::milliseconds(400)) );
 }