From f50ec041a0f6fa036305ab5d5bdbdb9116b48024 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 8 Jun 2025 12:12:15 +0200 Subject: gui: add more ParticipantEditor editing tests --- gui/tests/gtk-test.cpp | 54 ++++++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 33 deletions(-) (limited to 'gui/tests/gtk-test.cpp') diff --git a/gui/tests/gtk-test.cpp b/gui/tests/gtk-test.cpp index 8f897d9..385f772 100644 --- a/gui/tests/gtk-test.cpp +++ b/gui/tests/gtk-test.cpp @@ -3,49 +3,37 @@ * SPDX-License-Identifier: LGPL-2.1-only */ -#include "turnsmm/init.hpp" +#include "gtk-test.hpp" -#include -#include -#include - -#include -#include -#include -#include -#include +#include #include #include -namespace turns::ui::tests +namespace Turns::gui::tests { - struct gtk_test : Catch::EventListenerBase + auto gtk_test::testRunStarting(Catch::TestRunInfo const &) -> void { - using Catch::EventListenerBase::EventListenerBase; - - auto testRunStarting(Catch::TestRunInfo const &) -> void override - { - setlocale(LC_ALL, ""); - bindtextdomain("turns", TESTLOCALEDIR); - bind_textdomain_codeset("turns", "UTF-8"); - textdomain("turns"); - - m_app = Adwaita::Application::create("ch.arknet.turns.tests.ui"); - Turns::init(); - } + setlocale(LC_ALL, ""); + bindtextdomain("turns", TESTLOCALEDIR); + bind_textdomain_codeset("turns", "UTF-8"); + textdomain("turns"); - auto testCaseEnded(Catch::TestCaseStats const &) -> void override - { - setlocale(LC_ALL, ""); - } + application = Adwaita::Application::create("ch.arknet.turns.tests.ui"); + Turns::init(); + } - private: - Glib::RefPtr m_app{}; - }; + auto gtk_test::testRunEnded(Catch::TestRunStats const &) -> void + { + application->quit(); + application.reset(); + } - CATCH_REGISTER_LISTENER(gtk_test); + auto gtk_test::testCaseEnded(Catch::TestCaseStats const &) -> void + { + setlocale(LC_ALL, ""); + } -} // namespace turns::ui::tests \ No newline at end of file +} // namespace Turns::Gui::tests \ No newline at end of file -- cgit v1.2.3