diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/EventTest.cpp | 6 | ||||
-rw-r--r-- | src/test/InputTest.cpp | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/test/EventTest.cpp b/src/test/EventTest.cpp index f30f15a..f8be3fe 100644 --- a/src/test/EventTest.cpp +++ b/src/test/EventTest.cpp @@ -56,8 +56,7 @@ TEST_F(EventManagerTest, EventManagerTest_trigger_all_channels) { event_mgr.subscribe<MouseClickEvent>(mouse_handler, EventManager::CHANNEL_ALL); MouseClickEvent click_event{.mouse_pos = {100, 200}, .button = MouseButton::LEFT_MOUSE}; - event_mgr.trigger_event<MouseClickEvent>(click_event, - EventManager::CHANNEL_ALL); + event_mgr.trigger_event<MouseClickEvent>(click_event, EventManager::CHANNEL_ALL); EXPECT_TRUE(triggered); } @@ -74,8 +73,7 @@ TEST_F(EventManagerTest, EventManagerTest_trigger_one_channel) { event_mgr.subscribe<MouseClickEvent>(mouse_handler, test_channel); MouseClickEvent click_event{.mouse_pos = {100, 200}, .button = MouseButton::LEFT_MOUSE}; - event_mgr.trigger_event<MouseClickEvent>(click_event, - EventManager::CHANNEL_ALL); + event_mgr.trigger_event<MouseClickEvent>(click_event, EventManager::CHANNEL_ALL); EXPECT_FALSE(triggered); event_mgr.trigger_event<MouseClickEvent>(click_event, test_channel); diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp index 7063561..09163a6 100644 --- a/src/test/InputTest.cpp +++ b/src/test/InputTest.cpp @@ -43,8 +43,7 @@ protected: //mediator.component_manager = mgr; //event_manager.clear(); } - void TearDown() override { - } + void TearDown() override {} void simulate_mouse_click(int mouse_x, int mouse_y, Uint8 mouse_button) { SDL_Event event; @@ -210,8 +209,7 @@ TEST_F(InputTest, testButtonClick) { GameObject button_obj = mgr.new_object("body", "person", vec2{0, 0}, 0, 1); bool button_clicked = false; std::function<void()> on_click = [&]() { button_clicked = true; }; - auto & button - = button_obj.add_component<Button>(vec2{100, 100}, vec2{0, 0}, on_click); + auto & button = button_obj.add_component<Button>(vec2{100, 100}, vec2{0, 0}, on_click); bool hover = false; button.active = true; @@ -230,8 +228,7 @@ TEST_F(InputTest, testButtonHover) { GameObject button_obj = mgr.new_object("body", "person", vec2{0, 0}, 0, 1); bool button_clicked = false; std::function<void()> on_click = [&]() { button_clicked = true; }; - auto & button - = button_obj.add_component<Button>(vec2{100, 100}, vec2{0, 0}, on_click); + auto & button = button_obj.add_component<Button>(vec2{100, 100}, vec2{0, 0}, on_click); button.active = true; // Mouse not on button |