diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-08-15 11:43:20 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-08-15 11:43:20 +0200 |
| commit | 6b839ff6e2cf8a2b0e885a16e6876415f5ba1425 (patch) | |
| tree | 5a26fa8cd66eba290146cbdbb1364fa9d2407d96 /ui/tests | |
| parent | b6252045a1340a42a39426dfbb877d2a1f357b7f (diff) | |
| download | turns-6b839ff6e2cf8a2b0e885a16e6876415f5ba1425.tar.xz turns-6b839ff6e2cf8a2b0e885a16e6876415f5ba1425.zip | |
turns: use Glib::unwrap where appropriate
Diffstat (limited to 'ui/tests')
| -rw-r--r-- | ui/tests/windows/participant_editor.cpp | 17 | ||||
| -rw-r--r-- | ui/tests/windows/tracker.cpp | 9 |
2 files changed, 14 insertions, 12 deletions
diff --git a/ui/tests/windows/participant_editor.cpp b/ui/tests/windows/participant_editor.cpp index 2b3f5da..b721018 100644 --- a/ui/tests/windows/participant_editor.cpp +++ b/ui/tests/windows/participant_editor.cpp @@ -9,6 +9,7 @@ #include <glibmm/i18n.h> #include <glibmm/ustring.h> +#include <glibmm/wrap.h> #include <gtkmm/builder.h> #include <gtkmm/listboxrow.h> @@ -38,25 +39,25 @@ namespace turns::ui::windows::tests SECTION("has a non-empty title") { - auto widget = ADW_DIALOG(instance->gobj()); + auto widget = ADW_DIALOG(Glib::unwrap(instance)); REQUIRE(adw_dialog_get_title(widget)); } SECTION("has its title set according to the active language") { - auto widget = ADW_DIALOG(instance->gobj()); + auto widget = ADW_DIALOG(Glib::unwrap(instance)); REQUIRE(adw_dialog_get_title(widget) == Glib::ustring{_(lang::add_participant)}); } SECTION("has an empty name field") { - auto widget = GTK_EDITABLE(builder->get_widget<Gtk::ListBoxRow>("name")->gobj()); + auto widget = GTK_EDITABLE(Glib::unwrap(builder->get_widget<Gtk::ListBoxRow>("name"))); REQUIRE(Glib::ustring{gtk_editable_get_text(widget)}.empty()); } SECTION("has a zero priority field") { - auto widget = ADW_SPIN_ROW(builder->get_widget<Gtk::ListBoxRow>("priority")->gobj()); + auto widget = ADW_SPIN_ROW(Glib::unwrap(builder->get_widget<Gtk::ListBoxRow>("priority"))); REQUIRE(adw_spin_row_get_value(widget) == 0); } @@ -83,25 +84,25 @@ namespace turns::ui::windows::tests SECTION("has a non-empty title") { - auto widget = ADW_DIALOG(instance->gobj()); + auto widget = ADW_DIALOG(Glib::unwrap(instance)); REQUIRE(adw_dialog_get_title(widget)); } SECTION("has its title set according to the active language") { - auto widget = ADW_DIALOG(instance->gobj()); + auto widget = ADW_DIALOG(Glib::unwrap(instance)); REQUIRE(adw_dialog_get_title(widget) == Glib::ustring{_(lang::edit_participant)}); } SECTION("has its name field set according to its participant") { - auto widget = GTK_EDITABLE(builder->get_widget<Gtk::ListBoxRow>("name")->gobj()); + auto widget = GTK_EDITABLE(Glib::unwrap(builder->get_widget<Gtk::ListBoxRow>("name"))); REQUIRE(gtk_editable_get_text(widget) == participant->name().get_value()); } SECTION("has its priority field set according to its participant") { - auto widget = ADW_SPIN_ROW(builder->get_widget<Gtk::ListBoxRow>("priority")->gobj()); + auto widget = ADW_SPIN_ROW(Glib::unwrap(builder->get_widget<Gtk::ListBoxRow>("priority"))); REQUIRE(adw_spin_row_get_value(widget) == participant->priority()); } diff --git a/ui/tests/windows/tracker.cpp b/ui/tests/windows/tracker.cpp index 1fedd03..236dad0 100644 --- a/ui/tests/windows/tracker.cpp +++ b/ui/tests/windows/tracker.cpp @@ -7,6 +7,7 @@ #include <glibmm/i18n.h> #include <glibmm/ustring.h> +#include <glibmm/wrap.h> #include <gtkmm/builder.h> #include <gtkmm/button.h> @@ -36,28 +37,28 @@ namespace turns::ui::windows::tests SECTION("has a non-empty subtitle") { auto widget = builder->get_widget<Gtk::Widget>("title"); - auto adw = ADW_WINDOW_TITLE(widget->gobj()); + auto adw = ADW_WINDOW_TITLE(Glib::unwrap(widget)); REQUIRE(adw_window_title_get_subtitle(adw)); } SECTION("has its subtitle set according to the active language") { auto widget = builder->get_widget<Gtk::Widget>("title"); - auto adw = ADW_WINDOW_TITLE(widget->gobj()); + auto adw = ADW_WINDOW_TITLE(Glib::unwrap(widget)); REQUIRE(adw_window_title_get_subtitle(adw) == Glib::ustring{_(lang::no_active_turn_order)}); } SECTION("has a non-empty title") { auto widget = builder->get_widget<Gtk::Widget>("title"); - auto adw = ADW_WINDOW_TITLE(widget->gobj()); + auto adw = ADW_WINDOW_TITLE(Glib::unwrap(widget)); REQUIRE(adw_window_title_get_title(adw)); } SECTION("has its title set according to the active language") { auto widget = builder->get_widget<Gtk::Widget>("title"); - auto adw = ADW_WINDOW_TITLE(widget->gobj()); + auto adw = ADW_WINDOW_TITLE(Glib::unwrap(widget)); REQUIRE(adw_window_title_get_title(adw) == Glib::ustring{_(lang::turns)}); } |
