aboutsummaryrefslogtreecommitdiff
path: root/src/test/InputTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/InputTest.cpp')
-rw-r--r--src/test/InputTest.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp
index 73eaab3..8c42c43 100644
--- a/src/test/InputTest.cpp
+++ b/src/test/InputTest.cpp
@@ -83,7 +83,7 @@ TEST_F(InputTest, MouseDown) {
event.button.button = SDL_BUTTON_LEFT;
SDL_PushEvent(&event);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(mouse_triggered);
}
@@ -111,7 +111,7 @@ TEST_F(InputTest, MouseUp) {
event.button.button = SDL_BUTTON_LEFT;
SDL_PushEvent(&event);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(function_triggered);
}
@@ -141,7 +141,7 @@ TEST_F(InputTest, MouseMove) {
event.motion.yrel = 10;
SDL_PushEvent(&event);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(function_triggered);
}
@@ -171,7 +171,7 @@ TEST_F(InputTest, KeyDown) {
test_event.key.repeat = 1; // Set repeat flag
SDL_PushEvent(&test_event);
- input_system.update(); // Process the event
+ input_system.fixed_update(); // Process the event
event_manager.dispatch_events(); // Dispatch events to handlers
EXPECT_TRUE(function_triggered); // Check if the handler was triggered
@@ -196,7 +196,7 @@ TEST_F(InputTest, KeyUp) {
event.key.keysym.scancode = SDL_SCANCODE_B;
SDL_PushEvent(&event);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(function_triggered);
}
@@ -217,7 +217,7 @@ TEST_F(InputTest, MouseClick) {
event_manager.subscribe<MouseClickEvent>(on_mouse_click);
this->simulate_mouse_click(250, 250, SDL_BUTTON_LEFT);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(on_click_triggered);
}
@@ -239,12 +239,12 @@ TEST_F(InputTest, testButtonClick) {
button.is_pressed = false;
button.is_toggle = false;
this->simulate_mouse_click(999, 999, SDL_BUTTON_LEFT);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_FALSE(button_clicked);
this->simulate_mouse_click(250, 250, SDL_BUTTON_LEFT);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(button_clicked);
}
@@ -273,7 +273,7 @@ TEST_F(InputTest, testButtonHover) {
event.motion.yrel = 10;
SDL_PushEvent(&event);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_FALSE(button.hover);
@@ -287,7 +287,7 @@ TEST_F(InputTest, testButtonHover) {
hover_event.motion.yrel = 10;
SDL_PushEvent(&hover_event);
- input_system.update();
+ input_system.fixed_update();
event_manager.dispatch_events();
EXPECT_TRUE(button.hover);
}