PPI: Fix IntervalTimer unit test
g0dil [Fri, 20 Mar 2009 13:38:24 +0000 (13:38 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1164 270642c3-0616-0410-b53a-bc976706d245

PPI/IntervalTimer.test.cc
PPI/SocketSource.ct

index b32cc31..45f87f9 100644 (file)
@@ -56,7 +56,7 @@ namespace {
         unsigned n;
 
     public:
-        TimerTest(senf::ClockService::clock_type d_, unsigned n_)
+        TimerTest(senf::ClockService::int64_type d_, unsigned n_)
         :   timer ( senf::ClockService::milliseconds(d_) ),
             n     ( n_ )
         {
@@ -73,13 +73,13 @@ namespace {
 
 BOOST_AUTO_UNIT_TEST(intervalTimer)
 {
-    TimerTest timer (100,4);
+    TimerTest timer (100,3);
     senf::ClockService::clock_type start (senf::ClockService::now());
     senf::ppi::run();
     BOOST_CHECK_PREDICATE( is_close_clock,
                            (senf::ClockService::now())
                            (start+senf::ClockService::milliseconds(300))
-                           (senf::ClockService::milliseconds(100)) );
+                           (senf::ClockService::milliseconds(80)) );
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////
index 7ea5506..a573858 100644 (file)
@@ -46,12 +46,18 @@ prefix_ Packet senf::ppi::DgramReader<Packet>::operator()(Handle handle)
 
 template <class Reader>
 prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource()
-{}
+{
+    registerEvent( event_, &ActiveSocketSource::read );
+    route(event_, output);
+}
 
 template <class Reader>
 prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Reader reader)
     : reader_(reader)
-{}
+{
+    registerEvent( event_, &ActiveSocketSource::read );
+    route(event_, output);
+}
 
 template <class Reader>
 prefix_ senf::ppi::module::ActiveSocketSource<Reader>::