Include Catch and tests for Core

Catch 1.2.1


Former-commit-id: 4149eaa61b21532d4d204db8a3771c6de8e4672c
This commit is contained in:
Gawaboumga
2015-08-21 11:46:46 +02:00
parent 2d07922478
commit f61aa8f36e
8 changed files with 566 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include <Nazara/Core/Clock.hpp>
#include <catch.hpp>
#include <thread>
SCENARIO("Clock", "[CORE][CLOCK]")
{
GIVEN("A clock paused")
{
nzUInt64 initialTime = 1;
NzClock clock(initialTime, true);
WHEN("We get time")
{
THEN("Time must be the initialTime")
{
REQUIRE(clock.GetMicroseconds() == initialTime);
}
AND_WHEN("We unpause it")
{
clock.Unpause();
THEN("Time must not be the initialTime")
{
std::this_thread::sleep_for(std::chrono::microseconds(10));
REQUIRE(clock.GetMicroseconds() != initialTime);
}
}
}
}
}