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 4c05e56..770d9b4 100644
--- a/src/test/InputTest.cpp
+++ b/src/test/InputTest.cpp
@@ -84,7 +84,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);
}
@@ -112,7 +112,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);
}
@@ -142,7 +142,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);
}
@@ -172,7 +172,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
@@ -197,7 +197,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);
}
@@ -218,7 +218,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);
}
@@ -240,12 +240,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);
}
@@ -274,7 +274,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);
@@ -288,7 +288,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);
}