diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-24 19:38:13 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-24 19:38:13 +0100 |
commit | 6e03da99701b1916ee2f6a3dd7d10f7d283f2dd9 (patch) | |
tree | aa9f88f0f8e48cb949488ae6932198d155cd58f2 | |
parent | 9f4f2fa8eac190ccb407c3f911ac5978cb4c3e3a (diff) |
loopTimer tests
-rw-r--r-- | src/test/loopTimerTest.cpp (renamed from src/test/gameLoopTest.cpp) | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/test/gameLoopTest.cpp b/src/test/loopTimerTest.cpp index af80b27..a3b1646 100644 --- a/src/test/gameLoopTest.cpp +++ b/src/test/loopTimerTest.cpp @@ -9,26 +9,24 @@ using namespace std; using namespace std::chrono_literals; using namespace crepe; -class GameLoopTest : public ::testing::Test { +class LoopTimerTest : public ::testing::Test { public: -LoopManager loop_manager; LoopTimer loop_timer = LoopTimer::get_instance(); protected: void SetUp() override { loop_timer.start(); - loop_manager.start(); } void TearDown() override { } }; -TEST_F(GameLoopTest, TestDeltaTime) { +TEST_F(LoopTimerTest, TestDeltaTime) { auto start_time = std::chrono::steady_clock::now(); loop_timer.update(); double delta_time = loop_timer.get_delta_time(); auto elapsed_time = std::chrono::steady_clock::now() - start_time; - EXPECT_LE(delta_time, std::chrono::duration<double>(elapsed_time).count()); // delta_time should match or be slightly less + EXPECT_LE(delta_time, std::chrono::duration<double>(elapsed_time).count()); } |