Fix the timeout test, now that we don't wait 1ms too much everytime

This commit is contained in:
louiz’
2016-07-28 10:47:44 +02:00
parent 5c78692fcd
commit 0d1e0629e7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ bool TimedEvent::is_after(const TimedEvent& other) const
bool TimedEvent::is_after(const std::chrono::steady_clock::time_point& time_point) const bool TimedEvent::is_after(const std::chrono::steady_clock::time_point& time_point) const
{ {
return this->time_point >= time_point; return this->time_point > time_point;
} }
std::chrono::milliseconds TimedEvent::get_timeout() const std::chrono::milliseconds TimedEvent::get_timeout() const
+1 -1
View File
@@ -39,7 +39,7 @@ TEST_CASE("Test timed event expiration")
std::chrono::milliseconds timoute = TimedEventsManager::instance().get_timeout(); std::chrono::milliseconds timoute = TimedEventsManager::instance().get_timeout();
INFO("Sleeping for " << timoute.count() << "ms"); INFO("Sleeping for " << timoute.count() << "ms");
std::this_thread::sleep_for(timoute); std::this_thread::sleep_for(timoute + 1ms);
// Event is now expired // Event is now expired
CHECK(TimedEventsManager::instance().execute_expired_events() == 1); CHECK(TimedEventsManager::instance().execute_expired_events() == 1);