From 66ed63166173ccbf5279f6204a1b4099daf176ec Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 5 Jun 2025 18:00:36 +0200 Subject: gui: extract resource path strings --- gui/tests/resources.cpp | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'gui/tests') diff --git a/gui/tests/resources.cpp b/gui/tests/resources.cpp index ccabf74..c58e217 100644 --- a/gui/tests/resources.cpp +++ b/gui/tests/resources.cpp @@ -3,6 +3,8 @@ * SPDX-License-Identifier: LGPL-2.1-only */ +#include "resources.hpp" + #include #include @@ -10,25 +12,31 @@ #include -SCENARIO("Resources are correctly bundled") +namespace Turns::gui::tests { - auto file = GENERATE("/ch/arknet/Turns/participant_editor.ui", - "/ch/arknet/Turns/participant_row.ui", - "/ch/arknet/Turns/preferences.ui", - "/ch/arknet/Turns/tracker.ui", - "/ch/arknet/Turns/turn_order_view.ui"); - - GIVEN(std::format("The resource path '{}'", file)) + SCENARIO("Resources are correctly bundled") { - WHEN("looking for a global resource at that path") - { - auto exists = Gio::Resource::get_file_exists_global_nothrow(file); - THEN("one exists") + auto file = GENERATE(resource::metainfo_xml, + resource::participant_editor_ui, + resource::participant_row_ui, + resource::preferences_ui, + resource::tracker_ui, + resource::turn_order_view_ui); + + GIVEN(std::format("The resource path '{}'", file)) + { + WHEN("looking for a global resource at that path") { - REQUIRE(exists); + auto exists = Gio::Resource::get_file_exists_global_nothrow(file); + + THEN("one exists") + { + REQUIRE(exists); + } } } } -} + +} // namespace Turns::gui::tests \ No newline at end of file -- cgit v1.2.3