aboutsummaryrefslogtreecommitdiff
path: root/src/test/InputTest.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-09 15:29:51 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-09 15:29:51 +0100
commitf6633670594e04baf77c14399c9f3bdaa49aecea (patch)
tree128a4e68e7efeba002322b6df34fa9f60a6ab27f /src/test/InputTest.cpp
parenta80477f2e7f4c18adcc6441828d17582aad2598f (diff)
make format
Diffstat (limited to 'src/test/InputTest.cpp')
-rw-r--r--src/test/InputTest.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp
index e9dc645..5150960 100644
--- a/src/test/InputTest.cpp
+++ b/src/test/InputTest.cpp
@@ -332,30 +332,30 @@ TEST_F(InputTest, WindowMoveTest) {
EXPECT_TRUE(callback_triggered);
}
TEST_F(InputTest, KeyboardStateTest) {
- SDLContext& sdl_context = this->mediator.sdl_context;
- // Simulate pressing a key
- SDL_Event key_down_event;
- SDL_zero(key_down_event);
- key_down_event.type = SDL_KEYDOWN;
- key_down_event.key.keysym.scancode = SDL_SCANCODE_A;
+ SDLContext & sdl_context = this->mediator.sdl_context;
+ // Simulate pressing a key
+ SDL_Event key_down_event;
+ SDL_zero(key_down_event);
+ key_down_event.type = SDL_KEYDOWN;
+ key_down_event.key.keysym.scancode = SDL_SCANCODE_A;
key_down_event.key.keysym.sym = SDL_SCANCODE_A;
- SDL_PushEvent(&key_down_event);
+ SDL_PushEvent(&key_down_event);
- // Check the keyboard state
- auto keyboard_state = sdl_context.get_keyboard_state();
+ // Check the keyboard state
+ auto keyboard_state = sdl_context.get_keyboard_state();
- // Verify the state of the 'A' key
- EXPECT_TRUE(keyboard_state[Keycode::A]);
+ // Verify the state of the 'A' key
+ EXPECT_TRUE(keyboard_state[Keycode::A]);
- // Simulate releasing a key
- SDL_Event key_up_event;
- SDL_zero(key_up_event);
- key_up_event.type = SDL_KEYUP;
- key_up_event.key.keysym.scancode = SDL_SCANCODE_A; // Simulate releasing 'A' key
- SDL_PushEvent(&key_up_event);
- // Check the keyboard state again
- keyboard_state = sdl_context.get_keyboard_state();
+ // Simulate releasing a key
+ SDL_Event key_up_event;
+ SDL_zero(key_up_event);
+ key_up_event.type = SDL_KEYUP;
+ key_up_event.key.keysym.scancode = SDL_SCANCODE_A; // Simulate releasing 'A' key
+ SDL_PushEvent(&key_up_event);
+ // Check the keyboard state again
+ keyboard_state = sdl_context.get_keyboard_state();
- // Verify the state of the 'A' key
- EXPECT_FALSE(keyboard_state[Keycode::A]);
+ // Verify the state of the 'A' key
+ EXPECT_FALSE(keyboard_state[Keycode::A]);
}