mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
tests/EventMap: Test for event past it's execution time
With the switch to std::chrono return type of GetTimeUntilEvent we don't run into an overflow condition which happend with the previous uint32 return value if the events scheduled execution time is in the past. Test for this case.
This commit is contained in:
committed by
Peter Keresztes Schmidt
parent
8cb35b0d5f
commit
e877f988d1
@@ -66,6 +66,13 @@ TEST_CASE("Schedule an event", "[EventMap]")
|
||||
REQUIRE(eventMap.Empty());
|
||||
REQUIRE(eventMap.GetTimeUntilEvent(EVENT_1) == Milliseconds::max());
|
||||
}
|
||||
|
||||
SECTION("Event is past it's execution time")
|
||||
{
|
||||
eventMap.Update(2000);
|
||||
|
||||
REQUIRE(eventMap.GetTimeUntilEvent(EVENT_1) == -1s);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: The semantics of this case are not well defined.
|
||||
|
||||
Reference in New Issue
Block a user