fix bug in rescheduleTask;
use PeriodicTask instead (so it won't delete itself)
diff --git a/test/test-event-scheduler.cc b/test/test-event-scheduler.cc
index 4db9a0e..0d70abf 100644
--- a/test/test-event-scheduler.cc
+++ b/test/test-event-scheduler.cc
@@ -26,6 +26,7 @@
 #include "random-interval-generator.h"
 
 #include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
 #include <map>
 #include <unistd.h>
 
@@ -136,6 +137,26 @@
   scheduler->shutdown();
 }
 
+void reschedule();
+SchedulerPtr schd0(new Scheduler());
+int resCount;
+TaskPtr task0(new PeriodicTask(boost::bind(reschedule), "testtest", schd0, boost::make_shared<SimpleIntervalGenerator>(0.5)));
+void reschedule()
+{
+  schd0->rescheduleTask(task0);
+  resCount++;
+}
+
+BOOST_AUTO_TEST_CASE(RescheduleTest)
+{
+  resCount = 0;
+  schd0->start();
+  schd0->addTask(task0);
+  usleep(5100000);
+  BOOST_CHECK_EQUAL(resCount, 10);
+  schd0->shutdown();
+}
+
 BOOST_AUTO_TEST_CASE(GeneratorTest)
 {
   double interval = 10;