Commit Graph

4 Commits

Author SHA1 Message Date
Carbenium
a5d85deced Core/EventMap: Unify semantics of DelayEvents
DelayEvents(Milliseconds delay) had different semantics than
DelayEvents(Milliseconds delay, uint32 group).
The first method delayed the events only in the case the internal timer
already ticked at least for the amount of delay. In contrast the latter method
delayed events regardless of the internal timer value.

Use the latter semantics for DelayEvents(Milliseconds delay) as well which makes
the outcome more predictable. Adapt tests accordingly.

(cherry picked from commit 4470b91223)
2022-01-24 00:01:25 +01:00
Carbenium
5512eb2f8f 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.

(cherry picked from commit e877f988d1)
2022-01-24 00:00:47 +01:00
Carbenium
27c1f47598 EventMap: Change GetTimeUntilEvent to return std::chrono types
(cherry picked from commit 8cb35b0d5f)
2022-01-23 23:59:46 +01:00
Carbenium
ddeae5e7d2 tests: Add some basic tests for EventMap
(cherry picked from commit 7950275697)
2022-01-23 22:48:58 +01:00