Scheduler: Fix TimerEvent unit test reliability
g0dil [Tue, 3 Feb 2009 16:21:37 +0000 (16:21 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1097 270642c3-0616-0410-b53a-bc976706d245

Scheduler/TimerEvent.test.cc

index cbab9f6..e4f2b98 100644 (file)
@@ -28,6 +28,7 @@
 
 // Custom includes
 #include "TimerEvent.hh"
+#include "Scheduler.hh"
 
 #include "../Utils//auto_unit_test.hh"
 #include <boost/test/test_tools.hpp>
@@ -61,12 +62,7 @@ BOOST_AUTO_UNIT_TEST(timerDispatcher)
         SENF_CHECK_NO_THROW( timer.disable() );
         SENF_CHECK_NO_THROW( timer.enable() );
         BOOST_CHECK( timer.enabled() );
-        SENF_CHECK_NO_THROW( senf::scheduler::detail::TimerDispatcher::instance().enable() );
-        SENF_CHECK_NO_THROW( senf::scheduler::detail::TimerDispatcher::instance().reschedule() );
-        SENF_CHECK_NO_THROW( senf::scheduler::detail::FdManager::instance().processOnce() );
-        SENF_CHECK_NO_THROW( senf::scheduler::detail::TimerDispatcher::instance().prepareRun() );
-        SENF_CHECK_NO_THROW( senf::scheduler::detail::FIFORunner::instance().run() );
-        SENF_CHECK_NO_THROW( senf::scheduler::detail::TimerDispatcher::instance().disable() );
+        SENF_CHECK_NO_THROW( senf::scheduler::process() );
         senf::ClockService::clock_type t2 (senf::ClockService::now());
         BOOST_CHECK( called );
         BOOST_CHECK( ! timer.enabled() );