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.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp
index d893276..64fc525 100644
--- a/src/test/InputTest.cpp
+++ b/src/test/InputTest.cpp
@@ -39,7 +39,7 @@ protected:
auto & camera
= obj.add_component<Camera>(ivec2{500, 500}, vec2{500, 500},
Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f});
- render.update();
+ render.frame_update();
//mediator.event_manager = event_manager;
//mediator.component_manager = mgr;
//event_manager.clear();
@@ -87,7 +87,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);
}
@@ -137,7 +137,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);
}
@@ -163,7 +163,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
@@ -184,7 +184,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);
}
@@ -201,7 +201,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);
}
@@ -215,12 +215,12 @@ TEST_F(InputTest, testButtonClick) {
bool hover = false;
button.active = true;
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);
}
@@ -242,7 +242,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);
@@ -256,7 +256,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);
}