aboutsummaryrefslogtreecommitdiff
path: root/src/test/LoopManagerTest.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 14:16:40 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 14:16:40 +0100
commitf64b793ad8e796458c8e175f298e8d13eb3b3459 (patch)
treec939140d97f5d3aad7c493198019cf9c1a72d8a4 /src/test/LoopManagerTest.cpp
parent6cd6ed3eb2a14e703e97bf95fe1b73fb8d3d91f4 (diff)
feedback
Diffstat (limited to 'src/test/LoopManagerTest.cpp')
-rw-r--r--src/test/LoopManagerTest.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/test/LoopManagerTest.cpp b/src/test/LoopManagerTest.cpp
index c44ebda..4e0ecdc 100644
--- a/src/test/LoopManagerTest.cpp
+++ b/src/test/LoopManagerTest.cpp
@@ -16,7 +16,6 @@ protected:
public:
MOCK_METHOD(void, fixed_update, (), (override));
MOCK_METHOD(void, frame_update, (), (override));
- MOCK_METHOD(void, render, (), (override));
};
TestGameLoop test_loop;
@@ -25,10 +24,9 @@ protected:
TEST_F(LoopManagerTest, FixedUpdate) {
// Arrange
- test_loop.loop_timer.set_target_fps(60);
+ test_loop.loop_timer.set_target_framerate(60);
// Set expectations for the mock calls
- EXPECT_CALL(test_loop, render).Times(::testing::Exactly(60));
EXPECT_CALL(test_loop, frame_update).Times(::testing::Exactly(60));
EXPECT_CALL(test_loop, fixed_update).Times(::testing::Exactly(50));
@@ -47,10 +45,9 @@ TEST_F(LoopManagerTest, FixedUpdate) {
}
TEST_F(LoopManagerTest, ScaledFixedUpdate) {
// Arrange
- test_loop.loop_timer.set_target_fps(60);
+ test_loop.loop_timer.set_target_framerate(60);
// Set expectations for the mock calls
- EXPECT_CALL(test_loop, render).Times(::testing::Exactly(60));
EXPECT_CALL(test_loop, frame_update).Times(::testing::Exactly(60));
EXPECT_CALL(test_loop, fixed_update).Times(::testing::Exactly(50));
@@ -69,9 +66,8 @@ TEST_F(LoopManagerTest, ScaledFixedUpdate) {
}
TEST_F(LoopManagerTest, ShutDown) {
// Arrange
- test_loop.loop_timer.set_target_fps(60);
+ test_loop.loop_timer.set_target_framerate(60);
- EXPECT_CALL(test_loop, render).Times(::testing::AtLeast(1));
EXPECT_CALL(test_loop, frame_update).Times(::testing::AtLeast(1));
EXPECT_CALL(test_loop, fixed_update).Times(::testing::AtLeast(1));
// Start the loop in a separate thread
@@ -80,6 +76,4 @@ TEST_F(LoopManagerTest, ShutDown) {
test_loop.event_manager.trigger_event<ShutDownEvent>(ShutDownEvent{});
// Wait for the loop thread to finish
loop_thread.join();
-
- // Test finished
}