Commit Graph

11 Commits

Author SHA1 Message Date
Treeston
f45aa5cac1 Common/Util: Trinity::StringTo<double> support (PR #25364) 2020-09-02 22:04:45 +02:00
Treeston
8ce3635d39 UnitTests: Cleanup + StringConvert/ChatCommand tests (PR #25353) 2020-08-29 22:03:22 +02:00
Carbenium
228696bf80 Core/Common: Merge TimeTrackerSmall with TimeTracker 2020-08-01 12:43:55 +02:00
Carbenium
e55516348d Core/Common: Add a std::chrono interface to TimeTrackerSmall
New methods:
TimeTrackerSmall(Milliseconds expiry);
void Update(Milliseconds diff);
void Reset(Milliseconds expiry)
Milliseconds GetExpiry() const

Removed methods:
int32 GetExpiry() const

Also add basic unit tests.

Core/Scripts: Use std::chrono interface of TimeTrackerSmall
2020-08-01 12:43:55 +02:00
Carbenium
e6f36f83b8 tests/EventMap: Add tests for Repeat 2020-07-26 23:20:11 +02:00
Carbenium
7865c1c197 Core/EventMap: Clarify documentation of ScheduleEvent 2020-07-26 23:20:11 +02:00
Carbenium
4470b91223 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.
2020-07-26 23:20:11 +02:00
Carbenium
e877f988d1 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.
2020-07-26 23:20:11 +02:00
Carbenium
8cb35b0d5f EventMap: Change GetTimeUntilEvent to return std::chrono types 2020-07-26 23:20:11 +02:00
Carbenium
7950275697 tests: Add some basic tests for EventMap 2020-07-24 12:00:54 +02:00
Carbenium
6a28ee7b2a dep: Add catch2 unit test framework and wire it up
To enable the test suite, make sure to configure CMake with -DBUILD_TESTING=1 , since it is disabled by default. The catch2 dependency will be downloaded during configure time.

Also add a new target "tests-common", which includes unit tests for the "common" project. To finally run the tests use the "test" target.

CircleCI: Run unit tests
2020-07-24 12:00:54 +02:00