[libadwaita/msvc: 270/271] tests: Remove g_auto* usage
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/msvc: 270/271] tests: Remove g_auto* usage
- Date: Tue, 12 Oct 2021 05:29:41 +0000 (UTC)
commit 45cc7500d531f3c6a8fda8264733597b187ac88d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Jul 26 19:00:02 2021 +0800
tests: Remove g_auto* usage
It is unfortunately a GCCism, so use the traditional method instead.
Unfortunately the autocleanup compiler extensions are not standard across the
board.
tests/test-action-row.c | 18 ++--
tests/test-application-window.c | 4 +-
tests/test-bin.c | 3 +-
tests/test-carousel-indicator-dots.c | 4 +-
tests/test-carousel-indicator-lines.c | 4 +-
tests/test-combo-row.c | 15 +++-
tests/test-expander-row.c | 24 ++++--
tests/test-flap.c | 56 +++++++++----
tests/test-header-bar.c | 24 ++++--
tests/test-leaflet.c | 33 ++++++--
tests/test-preferences-group.c | 12 ++-
tests/test-preferences-page.c | 12 ++-
tests/test-preferences-row.c | 8 +-
tests/test-preferences-window.c | 4 +-
tests/test-squeezer.c | 28 +++++--
tests/test-status-page.c | 12 ++-
tests/test-tab-bar.c | 34 ++++++--
tests/test-tab-view.c | 154 ++++++++++++++++++++++++----------
tests/test-view-switcher-bar.c | 8 +-
tests/test-view-switcher.c | 8 +-
tests/test-window-title.c | 8 +-
tests/test-window.c | 4 +-
22 files changed, 349 insertions(+), 128 deletions(-)
---
diff --git a/tests/test-action-row.c b/tests/test-action-row.c
index ff9283d3..7e4ccbbb 100644
--- a/tests/test-action-row.c
+++ b/tests/test-action-row.c
@@ -18,7 +18,7 @@ activated_cb (GtkWidget *widget, gpointer data)
static void
test_adw_action_row_add_remove (void)
{
- g_autoptr (AdwActionRow) row = NULL;
+ AdwActionRow *row = NULL;
GtkWidget *prefix, *suffix;
row = g_object_ref_sink (ADW_ACTION_ROW (adw_action_row_new ()));
@@ -35,13 +35,14 @@ test_adw_action_row_add_remove (void)
adw_action_row_remove (row, prefix);
adw_action_row_remove (row, suffix);
+ g_object_unref (row);
}
static void
test_adw_action_row_subtitle (void)
{
- g_autoptr (AdwActionRow) row = NULL;
+ AdwActionRow *row = NULL;
row = g_object_ref_sink (ADW_ACTION_ROW (adw_action_row_new ()));
g_assert_nonnull (row);
@@ -50,13 +51,14 @@ test_adw_action_row_subtitle (void)
adw_action_row_set_subtitle (row, "Dummy subtitle");
g_assert_cmpstr (adw_action_row_get_subtitle (row), ==, "Dummy subtitle");
+ g_object_unref (row);
}
static void
test_adw_action_row_icon_name (void)
{
- g_autoptr (AdwActionRow) row = NULL;
+ AdwActionRow *row = NULL;
row = g_object_ref_sink (ADW_ACTION_ROW (adw_action_row_new ()));
g_assert_nonnull (row);
@@ -65,13 +67,14 @@ test_adw_action_row_icon_name (void)
adw_action_row_set_icon_name (row, "dummy-icon-name");
g_assert_cmpstr (adw_action_row_get_icon_name (row), ==, "dummy-icon-name");
+ g_object_unref (row);
}
static void
test_adw_action_row_title_lines (void)
{
- g_autoptr (AdwActionRow) row = NULL;
+ AdwActionRow *row = NULL;
row = g_object_ref_sink (ADW_ACTION_ROW (adw_action_row_new ()));
g_assert_nonnull (row);
@@ -86,13 +89,14 @@ test_adw_action_row_title_lines (void)
adw_action_row_set_title_lines (row, 1);
g_assert_cmpint (adw_action_row_get_title_lines (row), ==, 1);
+ g_object_unref (row);
}
static void
test_adw_action_row_subtitle_lines (void)
{
- g_autoptr (AdwActionRow) row = NULL;
+ AdwActionRow *row = NULL;
row = g_object_ref_sink (ADW_ACTION_ROW (adw_action_row_new ()));
g_assert_nonnull (row);
@@ -107,13 +111,14 @@ test_adw_action_row_subtitle_lines (void)
adw_action_row_set_subtitle_lines (row, 1);
g_assert_cmpint (adw_action_row_get_subtitle_lines (row), ==, 1);
+ g_object_unref (row);
}
static void
test_adw_action_row_activate (void)
{
- g_autoptr (AdwActionRow) row = NULL;
+ AdwActionRow *row = NULL;
row = g_object_ref_sink (ADW_ACTION_ROW (adw_action_row_new ()));
g_assert_nonnull (row);
@@ -123,6 +128,7 @@ test_adw_action_row_activate (void)
adw_action_row_activate (row);
g_assert_cmpint (activated, ==, 1);
+ g_object_unref (row);
}
diff --git a/tests/test-application-window.c b/tests/test-application-window.c
index 5936974a..66e7db12 100644
--- a/tests/test-application-window.c
+++ b/tests/test-application-window.c
@@ -10,10 +10,12 @@
static void
test_adw_application_window_new (void)
{
- g_autoptr (GtkWidget) window = NULL;
+ GtkWidget *window = NULL;
window = g_object_ref_sink (adw_application_window_new (NULL));
g_assert_nonnull (window);
+
+ g_object_unref (window);
}
diff --git a/tests/test-bin.c b/tests/test-bin.c
index dd61b87f..982b2be3 100644
--- a/tests/test-bin.c
+++ b/tests/test-bin.c
@@ -19,7 +19,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_bin_child (void)
{
- g_autoptr (AdwBin) bin = NULL;
+ AdwBin *bin = NULL;
GtkWidget *widget = NULL;
bin = g_object_ref_sink (ADW_BIN (adw_bin_new ()));
@@ -42,6 +42,7 @@ test_adw_bin_child (void)
g_object_set (bin, "child", NULL, NULL);
g_assert_null (adw_bin_get_child (bin));
g_assert_cmpint (notified, ==, 2);
+ g_object_unref (bin);
}
int
diff --git a/tests/test-carousel-indicator-dots.c b/tests/test-carousel-indicator-dots.c
index 09ff42e2..9e97a9b9 100644
--- a/tests/test-carousel-indicator-dots.c
+++ b/tests/test-carousel-indicator-dots.c
@@ -17,7 +17,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_carousel_indicator_dots_carousel (void)
{
- g_autoptr (AdwCarouselIndicatorDots) dots = NULL;
+ AdwCarouselIndicatorDots *dots = NULL;
AdwCarousel *carousel;
dots = g_object_ref_sink (ADW_CAROUSEL_INDICATOR_DOTS (adw_carousel_indicator_dots_new ()));
@@ -39,6 +39,8 @@ test_adw_carousel_indicator_dots_carousel (void)
adw_carousel_indicator_dots_set_carousel (dots, NULL);
g_assert_null (adw_carousel_indicator_dots_get_carousel (dots));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (dots);
}
int
diff --git a/tests/test-carousel-indicator-lines.c b/tests/test-carousel-indicator-lines.c
index f37416cb..229cefbf 100644
--- a/tests/test-carousel-indicator-lines.c
+++ b/tests/test-carousel-indicator-lines.c
@@ -17,7 +17,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_carousel_indicator_lines_carousel (void)
{
- g_autoptr (AdwCarouselIndicatorLines) lines = NULL;
+ AdwCarouselIndicatorLines *lines = NULL;
AdwCarousel *carousel;
lines = g_object_ref_sink (ADW_CAROUSEL_INDICATOR_LINES (adw_carousel_indicator_lines_new ()));
@@ -39,6 +39,8 @@ test_adw_carousel_indicator_lines_carousel (void)
adw_carousel_indicator_lines_set_carousel (lines, NULL);
g_assert_null (adw_carousel_indicator_lines_get_carousel (lines));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (lines);
}
int
diff --git a/tests/test-combo-row.c b/tests/test-combo-row.c
index 2c7cc819..8b4e60ae 100644
--- a/tests/test-combo-row.c
+++ b/tests/test-combo-row.c
@@ -17,7 +17,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_combo_row_set_for_enum (void)
{
- g_autoptr (AdwComboRow) row = NULL;
+ AdwComboRow *row = NULL;
GtkExpression *expr = NULL;
GListModel *model;
AdwEnumListItem *item;
@@ -47,13 +47,15 @@ test_adw_combo_row_set_for_enum (void)
item = g_list_model_get_item (model, 1);
g_assert_true (ADW_IS_ENUM_LIST_ITEM (item));
g_assert_cmpstr (adw_enum_list_item_get_nick (item), ==, "vertical");
+
+ g_object_unref (row);
}
static void
test_adw_combo_row_selected (void)
{
- g_autoptr (AdwComboRow) row = NULL;
- g_autoptr (GListModel) model = NULL;
+ AdwComboRow *row = NULL;
+ GListModel *model = NULL;
int selected = 0;
row = ADW_COMBO_ROW (g_object_ref_sink (adw_combo_row_new ()));
@@ -82,12 +84,15 @@ test_adw_combo_row_selected (void)
g_object_set (row, "selected", 1, NULL);
g_assert_cmpint (adw_combo_row_get_selected (row), ==, 1);
g_assert_cmpint (notified, ==, 3);
+
+ g_object_unref (model);
+ g_object_unref (row);
}
static void
test_adw_combo_row_use_subtitle (void)
{
- g_autoptr (AdwComboRow) row = NULL;
+ AdwComboRow *row = NULL;
gboolean use_subtitle = FALSE;
row = g_object_ref_sink (ADW_COMBO_ROW (adw_combo_row_new ()));
@@ -109,6 +114,8 @@ test_adw_combo_row_use_subtitle (void)
g_object_get (row, "use-subtitle", &use_subtitle, NULL);
g_assert_false (use_subtitle);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (row);
}
diff --git a/tests/test-expander-row.c b/tests/test-expander-row.c
index 9d82e350..389fca8a 100644
--- a/tests/test-expander-row.c
+++ b/tests/test-expander-row.c
@@ -10,7 +10,7 @@
static void
test_adw_expander_row_add_remove (void)
{
- g_autoptr (AdwExpanderRow) row = NULL;
+ AdwExpanderRow *row = NULL;
GtkWidget *child;
row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
@@ -21,13 +21,15 @@ test_adw_expander_row_add_remove (void)
adw_expander_row_add_row (row, child);
adw_expander_row_remove (row, child);
+
+ g_object_unref (row);
}
static void
test_adw_expander_row_subtitle (void)
{
- g_autoptr (AdwExpanderRow) row = NULL;
+ AdwExpanderRow *row = NULL;
row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
g_assert_nonnull (row);
@@ -36,13 +38,15 @@ test_adw_expander_row_subtitle (void)
adw_expander_row_set_subtitle (row, "Dummy subtitle");
g_assert_cmpstr (adw_expander_row_get_subtitle (row), ==, "Dummy subtitle");
+
+ g_object_unref (row);
}
static void
test_adw_expander_row_icon_name (void)
{
- g_autoptr (AdwExpanderRow) row = NULL;
+ AdwExpanderRow *row = NULL;
row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
g_assert_nonnull (row);
@@ -51,13 +55,15 @@ test_adw_expander_row_icon_name (void)
adw_expander_row_set_icon_name (row, "dummy-icon-name");
g_assert_cmpstr (adw_expander_row_get_icon_name (row), ==, "dummy-icon-name");
+
+ g_object_unref (row);
}
static void
test_adw_expander_row_expanded (void)
{
- g_autoptr (AdwExpanderRow) row = NULL;
+ AdwExpanderRow *row = NULL;
row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
g_assert_nonnull (row);
@@ -69,13 +75,15 @@ test_adw_expander_row_expanded (void)
adw_expander_row_set_expanded (row, FALSE);
g_assert_false (adw_expander_row_get_expanded (row));
+
+ g_object_unref (row);
}
static void
test_adw_expander_row_enable_expansion (void)
{
- g_autoptr (AdwExpanderRow) row = NULL;
+ AdwExpanderRow *row = NULL;
row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
g_assert_nonnull (row);
@@ -96,13 +104,15 @@ test_adw_expander_row_enable_expansion (void)
adw_expander_row_set_enable_expansion (row, TRUE);
g_assert_true (adw_expander_row_get_enable_expansion (row));
g_assert_true (adw_expander_row_get_expanded (row));
+
+ g_object_unref (row);
}
static void
test_adw_expander_row_show_enable_switch (void)
{
- g_autoptr (AdwExpanderRow) row = NULL;
+ AdwExpanderRow *row = NULL;
row = g_object_ref_sink (ADW_EXPANDER_ROW (adw_expander_row_new ()));
g_assert_nonnull (row);
@@ -114,6 +124,8 @@ test_adw_expander_row_show_enable_switch (void)
adw_expander_row_set_show_enable_switch (row, FALSE);
g_assert_false (adw_expander_row_get_show_enable_switch (row));
+
+ g_object_unref (row);
}
diff --git a/tests/test-flap.c b/tests/test-flap.c
index 9e9bf450..dc88a1bc 100644
--- a/tests/test-flap.c
+++ b/tests/test-flap.c
@@ -19,7 +19,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_flap_flap (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
GtkWidget *widget = NULL;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -42,12 +42,14 @@ test_adw_flap_flap (void)
g_object_set (flap, "flap", NULL, NULL);
g_assert_null (adw_flap_get_flap (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_separator (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
GtkWidget *widget = NULL;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -70,12 +72,14 @@ test_adw_flap_separator (void)
g_object_set (flap, "separator", NULL, NULL);
g_assert_null (adw_flap_get_separator (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_flap_position (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
GtkPackType position;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -97,12 +101,14 @@ test_adw_flap_flap_position (void)
g_object_set (flap, "flap-position", GTK_PACK_START, NULL);
g_assert_cmpint (adw_flap_get_flap_position (flap), ==, GTK_PACK_START);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_reveal_flap (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
gboolean reveal;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -126,12 +132,14 @@ test_adw_flap_reveal_flap (void)
g_object_set (flap, "reveal-flap", TRUE, NULL);
g_assert_true (adw_flap_get_reveal_flap (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_reveal_duration (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
guint duration;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -153,12 +161,14 @@ test_adw_flap_reveal_duration (void)
g_object_set (flap, "reveal-duration", 100, NULL);
g_assert_cmpint (adw_flap_get_reveal_duration (flap), ==, 100);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_reveal_progress (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
double progress;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -177,12 +187,14 @@ test_adw_flap_reveal_progress (void)
adw_flap_set_reveal_flap (flap, TRUE);
g_assert_cmpint (adw_flap_get_reveal_progress (flap), ==, 1.0);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_fold_policy (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
AdwFlapFoldPolicy policy;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -204,12 +216,14 @@ test_adw_flap_fold_policy (void)
g_object_set (flap, "fold-policy", ADW_FLAP_FOLD_POLICY_ALWAYS, NULL);
g_assert_cmpint (adw_flap_get_fold_policy (flap), ==, ADW_FLAP_FOLD_POLICY_ALWAYS);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_fold_duration (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
guint duration;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -231,12 +245,14 @@ test_adw_flap_fold_duration (void)
g_object_set (flap, "fold-duration", 100, NULL);
g_assert_cmpint (adw_flap_get_fold_duration (flap), ==, 100);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_folded (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
gboolean folded;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -254,12 +270,14 @@ test_adw_flap_folded (void)
adw_flap_set_fold_policy (flap, ADW_FLAP_FOLD_POLICY_ALWAYS);
g_assert_true (adw_flap_get_folded (flap));
g_assert_cmpint (notified, ==, 1);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_locked (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
gboolean locked;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -283,12 +301,14 @@ test_adw_flap_locked (void)
g_object_set (flap, "locked", FALSE, NULL);
g_assert_false (adw_flap_get_locked (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_transition_type (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
AdwFlapTransitionType policy;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -310,12 +330,14 @@ test_adw_flap_transition_type (void)
g_object_set (flap, "transition-type", ADW_FLAP_TRANSITION_TYPE_UNDER, NULL);
g_assert_cmpint (adw_flap_get_transition_type (flap), ==, ADW_FLAP_TRANSITION_TYPE_UNDER);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_modal (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
gboolean modal;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -339,12 +361,14 @@ test_adw_flap_modal (void)
g_object_set (flap, "modal", TRUE, NULL);
g_assert_true (adw_flap_get_modal (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_swipe_to_open (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
gboolean swipe_to_open;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -368,12 +392,14 @@ test_adw_flap_swipe_to_open (void)
g_object_set (flap, "swipe-to-open", TRUE, NULL);
g_assert_true (adw_flap_get_swipe_to_open (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
static void
test_adw_flap_swipe_to_close (void)
{
- g_autoptr (AdwFlap) flap = NULL;
+ AdwFlap *flap = NULL;
gboolean swipe_to_close;
flap = g_object_ref_sink (ADW_FLAP (adw_flap_new ()));
@@ -397,6 +423,8 @@ test_adw_flap_swipe_to_close (void)
g_object_set (flap, "swipe-to-close", TRUE, NULL);
g_assert_true (adw_flap_get_swipe_to_close (flap));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (flap);
}
int
diff --git a/tests/test-header-bar.c b/tests/test-header-bar.c
index c03a08bc..eb11a61c 100644
--- a/tests/test-header-bar.c
+++ b/tests/test-header-bar.c
@@ -10,7 +10,7 @@
static void
test_adw_header_bar_pack (void)
{
- g_autoptr (AdwHeaderBar) bar = NULL;
+ AdwHeaderBar *bar = NULL;
GtkWidget *widget;
bar = g_object_ref_sink (ADW_HEADER_BAR (adw_header_bar_new ()));
@@ -25,13 +25,15 @@ test_adw_header_bar_pack (void)
g_assert_nonnull (widget);
adw_header_bar_pack_end (bar, widget);
+
+ g_object_unref (bar);
}
static void
test_adw_header_bar_title_widget (void)
{
- g_autoptr (AdwHeaderBar) bar = NULL;
+ AdwHeaderBar *bar = NULL;
GtkWidget *widget;
bar = g_object_ref_sink (ADW_HEADER_BAR (adw_header_bar_new ()));
@@ -46,13 +48,15 @@ test_adw_header_bar_title_widget (void)
adw_header_bar_set_title_widget (bar, NULL);
g_assert_null (adw_header_bar_get_title_widget (bar));
+
+ g_object_unref (bar);
}
static void
test_adw_header_bar_show_start_title_buttons (void)
{
- g_autoptr (AdwHeaderBar) bar = NULL;
+ AdwHeaderBar *bar = NULL;
bar = g_object_ref_sink (ADW_HEADER_BAR (adw_header_bar_new ()));
g_assert_nonnull (bar);
@@ -64,13 +68,15 @@ test_adw_header_bar_show_start_title_buttons (void)
adw_header_bar_set_show_start_title_buttons (bar, TRUE);
g_assert_true (adw_header_bar_get_show_start_title_buttons (bar));
+
+ g_object_unref (bar);
}
static void
test_adw_header_bar_show_end_title_buttons (void)
{
- g_autoptr (AdwHeaderBar) bar = NULL;
+ AdwHeaderBar *bar = NULL;
bar = g_object_ref_sink (ADW_HEADER_BAR (adw_header_bar_new ()));
g_assert_nonnull (bar);
@@ -82,13 +88,15 @@ test_adw_header_bar_show_end_title_buttons (void)
adw_header_bar_set_show_end_title_buttons (bar, TRUE);
g_assert_true (adw_header_bar_get_show_end_title_buttons (bar));
+
+ g_object_unref (bar);
}
static void
test_adw_header_bar_decoration_layout (void)
{
- g_autoptr (AdwHeaderBar) bar = NULL;
+ AdwHeaderBar *bar = NULL;
bar = g_object_ref_sink (ADW_HEADER_BAR (adw_header_bar_new ()));
g_assert_nonnull (bar);
@@ -100,13 +108,15 @@ test_adw_header_bar_decoration_layout (void)
adw_header_bar_set_decoration_layout (bar, NULL);
g_assert_null (adw_header_bar_get_decoration_layout (bar));
+
+ g_object_unref (bar);
}
static void
test_adw_header_bar_centering_policy (void)
{
- g_autoptr (AdwHeaderBar) bar = NULL;
+ AdwHeaderBar *bar = NULL;
bar = g_object_ref_sink (ADW_HEADER_BAR (adw_header_bar_new ()));
g_assert_nonnull (bar);
@@ -118,6 +128,8 @@ test_adw_header_bar_centering_policy (void)
adw_header_bar_set_centering_policy (bar, ADW_CENTERING_POLICY_LOOSE);
g_assert_cmpint (adw_header_bar_get_centering_policy (bar), ==, ADW_CENTERING_POLICY_LOOSE);
+
+ g_object_unref (bar);
}
diff --git a/tests/test-leaflet.c b/tests/test-leaflet.c
index 93c9d4ea..e599da20 100644
--- a/tests/test-leaflet.c
+++ b/tests/test-leaflet.c
@@ -12,18 +12,20 @@ assert_page_position (GtkSelectionModel *pages,
GtkWidget *widget,
int position)
{
- g_autoptr (AdwLeafletPage) page = NULL;
+ AdwLeafletPage *page = NULL;
page = g_list_model_get_item (G_LIST_MODEL (pages), position);
g_assert_true (widget == adw_leaflet_page_get_child (page));
+
+ g_object_unref (page);
}
static void
test_adw_leaflet_adjacent_child (void)
{
- g_autoptr (AdwLeaflet) leaflet = NULL;
+ AdwLeaflet *leaflet = NULL;
GtkWidget *children[3];
int i;
GtkWidget *result;
@@ -66,13 +68,15 @@ test_adw_leaflet_adjacent_child (void)
result = adw_leaflet_get_adjacent_child (leaflet, ADW_NAVIGATION_DIRECTION_FORWARD);
g_assert_null (result);
+
+ g_object_unref (leaflet);
}
static void
test_adw_leaflet_navigate (void)
{
- g_autoptr (AdwLeaflet) leaflet = NULL;
+ AdwLeaflet *leaflet = NULL;
GtkWidget *children[3];
int i;
gboolean result;
@@ -113,16 +117,18 @@ test_adw_leaflet_navigate (void)
result = adw_leaflet_navigate (leaflet, ADW_NAVIGATION_DIRECTION_BACK);
g_assert_true (result);
g_assert_true (adw_leaflet_get_visible_child (leaflet) == children[0]);
+
+ g_object_unref (leaflet);
}
static void
test_adw_leaflet_prepend (void)
{
- g_autoptr (AdwLeaflet) leaflet = NULL;
+ AdwLeaflet *leaflet = NULL;
GtkWidget *labels[2];
int i;
- g_autoptr (GtkSelectionModel) pages = NULL;
+ GtkSelectionModel *pages = NULL;
leaflet = ADW_LEAFLET (adw_leaflet_new ());
g_assert_nonnull (leaflet);
@@ -140,16 +146,19 @@ test_adw_leaflet_prepend (void)
adw_leaflet_prepend (leaflet, labels[0]);
assert_page_position (pages, labels[0], 0);
assert_page_position (pages, labels[1], 1);
+
+ g_object_unref (pages);
+ g_object_unref (leaflet);
}
static void
test_adw_leaflet_insert_child_after (void)
{
- g_autoptr (AdwLeaflet) leaflet = NULL;
+ AdwLeaflet *leaflet = NULL;
GtkWidget *labels[3];
int i;
- g_autoptr (GtkSelectionModel) pages = NULL;
+ GtkSelectionModel *pages = NULL;
leaflet = ADW_LEAFLET (adw_leaflet_new ());
g_assert_nonnull (leaflet);
@@ -175,16 +184,19 @@ test_adw_leaflet_insert_child_after (void)
assert_page_position (pages, labels[0], 0);
assert_page_position (pages, labels[1], 1);
assert_page_position (pages, labels[2], 2);
+
+ g_object_unref (pages);
+ g_object_unref (leaflet);
}
static void
test_adw_leaflet_reorder_child_after (void)
{
- g_autoptr (AdwLeaflet) leaflet = NULL;
+ AdwLeaflet *leaflet = NULL;
GtkWidget *labels[3];
int i;
- g_autoptr (GtkSelectionModel) pages = NULL;
+ GtkSelectionModel *pages = NULL;
leaflet = ADW_LEAFLET (adw_leaflet_new ());
g_assert_nonnull (leaflet);
@@ -211,6 +223,9 @@ test_adw_leaflet_reorder_child_after (void)
assert_page_position (pages, labels[2], 0);
assert_page_position (pages, labels[1], 1);
assert_page_position (pages, labels[0], 2);
+
+ g_object_unref (pages);
+ g_object_unref (leaflet);
}
diff --git a/tests/test-preferences-group.c b/tests/test-preferences-group.c
index bc77d54c..e932a660 100644
--- a/tests/test-preferences-group.c
+++ b/tests/test-preferences-group.c
@@ -10,7 +10,7 @@
static void
test_adw_preferences_group_add_remove (void)
{
- g_autoptr (AdwPreferencesGroup) group = NULL;
+ AdwPreferencesGroup *group = NULL;
AdwPreferencesRow *row;
GtkWidget *widget;
@@ -30,13 +30,15 @@ test_adw_preferences_group_add_remove (void)
adw_preferences_group_remove (group, GTK_WIDGET (row));
adw_preferences_group_remove (group, widget);
+
+ g_object_unref (group);
}
static void
test_adw_preferences_group_title (void)
{
- g_autoptr (AdwPreferencesGroup) group = NULL;
+ AdwPreferencesGroup *group = NULL;
group = g_object_ref_sink (ADW_PREFERENCES_GROUP (adw_preferences_group_new ()));
g_assert_nonnull (group);
@@ -48,13 +50,15 @@ test_adw_preferences_group_title (void)
adw_preferences_group_set_title (group, NULL);
g_assert_cmpstr (adw_preferences_group_get_title (group), ==, "");
+
+ g_object_unref (group);
}
static void
test_adw_preferences_group_description (void)
{
- g_autoptr (AdwPreferencesGroup) group = NULL;
+ AdwPreferencesGroup *group = NULL;
group = g_object_ref_sink (ADW_PREFERENCES_GROUP (adw_preferences_group_new ()));
g_assert_nonnull (group);
@@ -66,6 +70,8 @@ test_adw_preferences_group_description (void)
adw_preferences_group_set_description (group, NULL);
g_assert_cmpstr (adw_preferences_group_get_description (group), ==, "");
+
+ g_object_unref (group);
}
diff --git a/tests/test-preferences-page.c b/tests/test-preferences-page.c
index a37d80aa..42a4d260 100644
--- a/tests/test-preferences-page.c
+++ b/tests/test-preferences-page.c
@@ -10,7 +10,7 @@
static void
test_adw_preferences_page_add_remove (void)
{
- g_autoptr (AdwPreferencesPage) page = NULL;
+ AdwPreferencesPage *page = NULL;
AdwPreferencesGroup *group;
page = g_object_ref_sink (ADW_PREFERENCES_PAGE (adw_preferences_page_new ()));
@@ -21,13 +21,14 @@ test_adw_preferences_page_add_remove (void)
adw_preferences_page_add (page, group);
adw_preferences_page_remove (page, group);
+ g_object_unref (page);
}
static void
test_adw_preferences_page_title (void)
{
- g_autoptr (AdwPreferencesPage) page = NULL;
+ AdwPreferencesPage *page = NULL;
page = g_object_ref_sink (ADW_PREFERENCES_PAGE (adw_preferences_page_new ()));
g_assert_nonnull (page);
@@ -39,13 +40,14 @@ test_adw_preferences_page_title (void)
adw_preferences_page_set_title (page, NULL);
g_assert_cmpstr (adw_preferences_page_get_title (page), ==, "");
+ g_object_unref (page);
}
static void
test_adw_preferences_page_icon_name (void)
{
- g_autoptr (AdwPreferencesPage) page = NULL;
+ AdwPreferencesPage *page = NULL;
page = g_object_ref_sink (ADW_PREFERENCES_PAGE (adw_preferences_page_new ()));
g_assert_nonnull (page);
@@ -57,13 +59,14 @@ test_adw_preferences_page_icon_name (void)
adw_preferences_page_set_icon_name (page, NULL);
g_assert_null (adw_preferences_page_get_icon_name (page));
+ g_object_unref (page);
}
static void
test_adw_preferences_page_use_underline (void)
{
- g_autoptr (AdwPreferencesPage) page = NULL;
+ AdwPreferencesPage *page = NULL;
page = g_object_ref_sink (ADW_PREFERENCES_PAGE (adw_preferences_page_new ()));
g_assert_nonnull (page);
@@ -75,6 +78,7 @@ test_adw_preferences_page_use_underline (void)
adw_preferences_page_set_use_underline (page, FALSE);
g_assert_false (adw_preferences_page_get_use_underline (page));
+ g_object_unref (page);
}
diff --git a/tests/test-preferences-row.c b/tests/test-preferences-row.c
index 1b04f356..a6f72394 100644
--- a/tests/test-preferences-row.c
+++ b/tests/test-preferences-row.c
@@ -10,7 +10,7 @@
static void
test_adw_preferences_row_title (void)
{
- g_autoptr (AdwPreferencesRow) row = NULL;
+ AdwPreferencesRow *row = NULL;
row = g_object_ref_sink (ADW_PREFERENCES_ROW (adw_preferences_row_new ()));
g_assert_nonnull (row);
@@ -22,13 +22,15 @@ test_adw_preferences_row_title (void)
adw_preferences_row_set_title (row, NULL);
g_assert_cmpstr (adw_preferences_row_get_title (row), ==, "");
+
+ g_object_unref (row);
}
static void
test_adw_preferences_row_use_undeline (void)
{
- g_autoptr (AdwPreferencesRow) row = NULL;
+ AdwPreferencesRow *row = NULL;
row = g_object_ref_sink (ADW_PREFERENCES_ROW (adw_preferences_row_new ()));
g_assert_nonnull (row);
@@ -40,6 +42,8 @@ test_adw_preferences_row_use_undeline (void)
adw_preferences_row_set_use_underline (row, FALSE);
g_assert_false (adw_preferences_row_get_use_underline (row));
+
+ g_object_unref (row);
}
diff --git a/tests/test-preferences-window.c b/tests/test-preferences-window.c
index 98c35d77..7e72ee53 100644
--- a/tests/test-preferences-window.c
+++ b/tests/test-preferences-window.c
@@ -10,7 +10,7 @@
static void
test_adw_preferences_window_add_remove (void)
{
- g_autoptr (AdwPreferencesWindow) window = NULL;
+ AdwPreferencesWindow *window = NULL;
AdwPreferencesPage *page;
window = g_object_ref_sink (ADW_PREFERENCES_WINDOW (adw_preferences_window_new ()));
@@ -21,6 +21,8 @@ test_adw_preferences_window_add_remove (void)
adw_preferences_window_add (window, page);
adw_preferences_window_remove (window, page);
+
+ g_object_unref (window);
}
diff --git a/tests/test-squeezer.c b/tests/test-squeezer.c
index 51d77af2..dca40804 100644
--- a/tests/test-squeezer.c
+++ b/tests/test-squeezer.c
@@ -10,7 +10,7 @@
static void
test_adw_squeezer_homogeneous (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
squeezer = g_object_ref_sink (ADW_SQUEEZER (adw_squeezer_new ()));
g_assert_nonnull (squeezer);
@@ -22,6 +22,8 @@ test_adw_squeezer_homogeneous (void)
adw_squeezer_set_homogeneous (squeezer, TRUE);
g_assert_true (adw_squeezer_get_homogeneous (squeezer));
+
+ g_object_unref (squeezer);
}
@@ -46,7 +48,7 @@ test_adw_squeezer_allow_none (void)
static void
test_adw_squeezer_transition_duration (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
squeezer = g_object_ref_sink (ADW_SQUEEZER (adw_squeezer_new ()));
g_assert_nonnull (squeezer);
@@ -58,13 +60,15 @@ test_adw_squeezer_transition_duration (void)
adw_squeezer_set_transition_duration (squeezer, -1);
g_assert_cmpuint (adw_squeezer_get_transition_duration (squeezer), ==, G_MAXUINT);
+
+ g_object_unref (squeezer);
}
static void
test_adw_squeezer_transition_type (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
squeezer = g_object_ref_sink (ADW_SQUEEZER (adw_squeezer_new ()));
g_assert_nonnull (squeezer);
@@ -76,25 +80,29 @@ test_adw_squeezer_transition_type (void)
adw_squeezer_set_transition_type (squeezer, ADW_SQUEEZER_TRANSITION_TYPE_NONE);
g_assert_cmpuint (adw_squeezer_get_transition_type (squeezer), ==, ADW_SQUEEZER_TRANSITION_TYPE_NONE);
+
+ g_object_unref (squeezer);
}
static void
test_adw_squeezer_transition_running (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
squeezer = g_object_ref_sink (ADW_SQUEEZER (adw_squeezer_new ()));
g_assert_nonnull (squeezer);
g_assert_false (adw_squeezer_get_transition_running (squeezer));
+
+ g_object_unref (squeezer);
}
static void
test_adw_squeezer_show_hide_child (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
GtkWidget *child;
squeezer = g_object_ref_sink (ADW_SQUEEZER (adw_squeezer_new ()));
@@ -114,13 +122,15 @@ test_adw_squeezer_show_hide_child (void)
adw_squeezer_remove (squeezer, child);
g_assert_null (adw_squeezer_get_visible_child (squeezer));
+
+ g_object_unref (squeezer);
}
static void
test_adw_squeezer_interpolate_size (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
squeezer = g_object_ref_sink (ADW_SQUEEZER (adw_squeezer_new ()));
g_assert_nonnull (squeezer);
@@ -132,13 +142,15 @@ test_adw_squeezer_interpolate_size (void)
adw_squeezer_set_interpolate_size (squeezer, FALSE);
g_assert_false (adw_squeezer_get_interpolate_size (squeezer));
+
+ g_object_unref (squeezer);
}
static void
test_adw_squeezer_page_enabled (void)
{
- g_autoptr (AdwSqueezer) squeezer = NULL;
+ AdwSqueezer *squeezer = NULL;
GtkWidget *child;
AdwSqueezerPage *page;
@@ -154,6 +166,8 @@ test_adw_squeezer_page_enabled (void)
adw_squeezer_page_set_enabled (page, TRUE);
g_assert_true (adw_squeezer_page_get_enabled (page));
+
+ g_object_unref (squeezer);
}
diff --git a/tests/test-status-page.c b/tests/test-status-page.c
index a1e0dbaf..339cf5fb 100644
--- a/tests/test-status-page.c
+++ b/tests/test-status-page.c
@@ -17,7 +17,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_status_page_icon_name (void)
{
- g_autoptr (AdwStatusPage) status_page = NULL;
+ AdwStatusPage *status_page = NULL;
const char *icon_name = NULL;
status_page = ADW_STATUS_PAGE (g_object_ref_sink (adw_status_page_new ()));
@@ -39,12 +39,14 @@ test_adw_status_page_icon_name (void)
g_object_set (status_page, "icon-name", "other-icon-symbolic", NULL);
g_assert_cmpstr (adw_status_page_get_icon_name (status_page), ==, "other-icon-symbolic");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (status_page);
}
static void
test_adw_status_page_title (void)
{
- g_autoptr (AdwStatusPage) status_page = NULL;
+ AdwStatusPage *status_page = NULL;
const char *title = NULL;
status_page = ADW_STATUS_PAGE (g_object_ref_sink (adw_status_page_new ()));
@@ -66,12 +68,14 @@ test_adw_status_page_title (void)
g_object_set (status_page, "title", "Other Title", NULL);
g_assert_cmpstr (adw_status_page_get_title (status_page), ==, "Other Title");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (status_page);
}
static void
test_adw_status_page_description (void)
{
- g_autoptr (AdwStatusPage) status_page = NULL;
+ AdwStatusPage *status_page = NULL;
const char *description = NULL;
status_page = ADW_STATUS_PAGE (g_object_ref_sink (adw_status_page_new ()));
@@ -93,6 +97,8 @@ test_adw_status_page_description (void)
g_object_set (status_page, "description", "Other description", NULL);
g_assert_cmpstr (adw_status_page_get_description (status_page), ==, "Other description");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (status_page);
}
int
diff --git a/tests/test-tab-bar.c b/tests/test-tab-bar.c
index cd7e8b5e..f41452ab 100644
--- a/tests/test-tab-bar.c
+++ b/tests/test-tab-bar.c
@@ -19,8 +19,8 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_tab_bar_view (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabBar *bar = NULL;
+ AdwTabView *view = NULL;
bar = g_object_ref_sink (ADW_TAB_BAR (adw_tab_bar_new ()));
g_assert_nonnull (bar);
@@ -42,12 +42,15 @@ test_adw_tab_bar_view (void)
g_object_set (bar, "view", NULL, NULL);
g_assert_null (adw_tab_bar_get_view (bar));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
+ g_object_unref (bar);
}
static void
test_adw_tab_bar_start_action_widget (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
+ AdwTabBar *bar = NULL;
GtkWidget *widget = NULL;
bar = g_object_ref_sink (ADW_TAB_BAR (adw_tab_bar_new ()));
@@ -70,12 +73,14 @@ test_adw_tab_bar_start_action_widget (void)
g_object_set (bar, "start-action-widget", NULL, NULL);
g_assert_null (adw_tab_bar_get_start_action_widget (bar));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (bar);
}
static void
test_adw_tab_bar_end_action_widget (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
+ AdwTabBar *bar = NULL;
GtkWidget *widget = NULL;
bar = g_object_ref_sink (ADW_TAB_BAR (adw_tab_bar_new ()));
@@ -98,12 +103,14 @@ test_adw_tab_bar_end_action_widget (void)
g_object_set (bar, "end-action-widget", NULL, NULL);
g_assert_null (adw_tab_bar_get_end_action_widget (bar));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (bar);
}
static void
test_adw_tab_bar_autohide (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
+ AdwTabBar *bar = NULL;
gboolean autohide = FALSE;
bar = g_object_ref_sink (ADW_TAB_BAR (adw_tab_bar_new ()));
@@ -125,13 +132,15 @@ test_adw_tab_bar_autohide (void)
g_object_set (bar, "autohide", TRUE, NULL);
g_assert_true (adw_tab_bar_get_autohide (bar));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (bar);
}
static void
test_adw_tab_bar_tabs_revealed (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabBar *bar = NULL;
+ AdwTabView *view = NULL;
gboolean tabs_revealed = FALSE;
AdwTabPage *page;
@@ -178,12 +187,15 @@ test_adw_tab_bar_tabs_revealed (void)
adw_tab_bar_set_autohide (bar, FALSE);
g_assert_true (adw_tab_bar_get_tabs_revealed (bar));
g_assert_cmpint (notified, ==, 7);
+
+ g_object_unref (view);
+ g_object_unref (bar);
}
static void
test_adw_tab_bar_expand_tabs (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
+ AdwTabBar *bar = NULL;
gboolean expand_tabs = FALSE;
bar = g_object_ref_sink (ADW_TAB_BAR (adw_tab_bar_new ()));
@@ -205,12 +217,14 @@ test_adw_tab_bar_expand_tabs (void)
g_object_set (bar, "expand-tabs", TRUE, NULL);
g_assert_true (adw_tab_bar_get_expand_tabs (bar));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (bar);
}
static void
test_adw_tab_bar_inverted (void)
{
- g_autoptr (AdwTabBar) bar = NULL;
+ AdwTabBar *bar = NULL;
gboolean inverted = FALSE;
bar = g_object_ref_sink (ADW_TAB_BAR (adw_tab_bar_new ()));
@@ -232,6 +246,8 @@ test_adw_tab_bar_inverted (void)
g_object_set (bar, "inverted", FALSE, NULL);
g_assert_false (adw_tab_bar_get_inverted (bar));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (bar);
}
int
diff --git a/tests/test-tab-view.c b/tests/test-tab-view.c
index eaeb0012..b063136a 100644
--- a/tests/test-tab-view.c
+++ b/tests/test-tab-view.c
@@ -77,7 +77,7 @@ check_selection_null (AdwTabView *view)
static void
test_adw_tab_view_n_pages (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
int n_pages;
@@ -111,12 +111,14 @@ test_adw_tab_view_n_pages (void)
adw_tab_view_close_page (view, page);
g_assert_cmpint (adw_tab_view_get_n_pages (view), ==, 2);
g_assert_cmpint (notified, ==, 4);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_n_pinned_pages (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
int n_pages;
@@ -150,16 +152,19 @@ test_adw_tab_view_n_pinned_pages (void)
adw_tab_view_set_page_pinned (view, page, FALSE);
g_assert_cmpint (adw_tab_view_get_n_pinned_pages (view), ==, 1);
g_assert_cmpint (notified, ==, 3);
+
+ g_object_unref (page);
+ g_object_unref (view);
}
static void
test_adw_tab_view_default_icon (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
GIcon *icon = NULL;
- g_autoptr (GIcon) icon1 = g_themed_icon_new ("go-previous-symbolic");
- g_autoptr (GIcon) icon2 = g_themed_icon_new ("go-next-symbolic");
- g_autofree char *icon_str = NULL;
+ GIcon *icon1 = g_themed_icon_new ("go-previous-symbolic");
+ GIcon *icon2 = g_themed_icon_new ("go-next-symbolic");
+ char *icon_str = NULL;
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
g_assert_nonnull (view);
@@ -171,6 +176,7 @@ test_adw_tab_view_default_icon (void)
icon_str = g_icon_to_string (icon);
g_assert_cmpstr (icon_str, ==, "adw-tab-icon-missing-symbolic");
g_assert_cmpint (notified, ==, 0);
+ g_free (icon_str);
adw_tab_view_set_default_icon (view, icon1);
g_object_get (view, "default-icon", &icon, NULL);
@@ -180,15 +186,19 @@ test_adw_tab_view_default_icon (void)
g_object_set (view, "default-icon", icon2, NULL);
g_assert_true (adw_tab_view_get_default_icon (view) == icon2);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
+ g_object_unref (icon2);
+ g_object_unref (icon1);
}
static void
test_adw_tab_view_menu_model (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
GMenuModel *model = NULL;
- g_autoptr (GMenuModel) model1 = G_MENU_MODEL (g_menu_new ());
- g_autoptr (GMenuModel) model2 = G_MENU_MODEL (g_menu_new ());
+ GMenuModel *model1 = G_MENU_MODEL (g_menu_new ());
+ GMenuModel *model2 = G_MENU_MODEL (g_menu_new ());
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
g_assert_nonnull (view);
@@ -208,15 +218,19 @@ test_adw_tab_view_menu_model (void)
g_object_set (view, "menu-model", model2, NULL);
g_assert_true (adw_tab_view_get_menu_model (view) == model2);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (model2);
+ g_object_unref (model1);
+ g_object_unref (view);
}
static void
test_adw_tab_view_shortcut_widget (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
GtkWidget *widget = NULL;
- g_autoptr (GtkWidget) widget1 = g_object_ref_sink (gtk_button_new ());
- g_autoptr (GtkWidget) widget2 = g_object_ref_sink (gtk_button_new ());
+ GtkWidget *widget1 = g_object_ref_sink (gtk_button_new ());
+ GtkWidget *widget2 = g_object_ref_sink (gtk_button_new ());
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
g_assert_nonnull (view);
@@ -236,12 +250,16 @@ test_adw_tab_view_shortcut_widget (void)
g_object_set (view, "shortcut-widget", widget2, NULL);
g_assert_true (adw_tab_view_get_shortcut_widget (view) == widget2);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (widget2);
+ g_object_unref (widget1);
+ g_object_unref (view);
}
static void
test_adw_tab_view_get_page (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
GtkWidget *child1, *child2, *child3;
AdwTabPage *page1, *page2, *page3;
@@ -271,12 +289,14 @@ test_adw_tab_view_get_page (void)
g_assert_true (adw_tab_page_get_child (page1) == child1);
g_assert_true (adw_tab_page_get_child (page2) == child2);
g_assert_true (adw_tab_page_get_child (page3) == child3);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_select (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page1, *page2, *selected_page;
gboolean ret;
@@ -329,12 +349,14 @@ test_adw_tab_view_select (void)
g_assert_true (adw_tab_view_get_selected_page (view) == page1);
g_assert_true (ret);
g_assert_cmpint (notified, ==, 5);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_add_basic (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[6];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -363,12 +385,14 @@ test_adw_tab_view_add_basic (void)
pages[5] = adw_tab_view_insert_pinned (view, gtk_button_new (), 1);
assert_page_positions (view, pages, 6, 3,
3, 5, 4, 1, 2, 0);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_add_auto (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[17];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -455,12 +479,14 @@ test_adw_tab_view_add_auto (void)
g_assert_true (adw_tab_page_get_parent (pages[16]) == pages[5]);
assert_page_positions (view, pages, 17, 3,
0, 1, 2, 15, 14, 11, 12, 13, 3, 4, 6, 8, 9, 7, 10, 5, 16);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_reorder (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[6];
gboolean ret;
@@ -501,12 +527,14 @@ test_adw_tab_view_reorder (void)
g_assert_true (ret);
assert_page_positions (view, pages, 6, 3,
0, 1, 2, 3, 4, 5);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_reorder_first_last (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[6];
gboolean ret;
@@ -557,12 +585,14 @@ test_adw_tab_view_reorder_first_last (void)
g_assert_true (ret);
assert_page_positions (view, pages, 6, 3,
0, 1, 2, 3, 4, 5);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_reorder_forward_backward (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[6];
gboolean ret;
@@ -613,12 +643,14 @@ test_adw_tab_view_reorder_forward_backward (void)
g_assert_true (ret);
assert_page_positions (view, pages, 6, 3,
1, 2, 0, 4, 5, 3);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_pin (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[4];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -661,12 +693,14 @@ test_adw_tab_view_pin (void)
adw_tab_view_set_page_pinned (view, pages[1], FALSE);
assert_page_positions (view, pages, 4, 2,
2, 0, 1, 3);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_close (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[3];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -692,12 +726,14 @@ test_adw_tab_view_close (void)
adw_tab_view_close_page (view, pages[0]);
assert_page_positions (view, pages, 0, 0);
g_assert_null (adw_tab_view_get_selected_page (view));
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_close_other (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[6];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -719,7 +755,7 @@ test_adw_tab_view_close_other (void)
static void
test_adw_tab_view_close_before_after (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[10];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -744,6 +780,8 @@ test_adw_tab_view_close_before_after (void)
adw_tab_view_close_pages_after (view, pages[0]);
assert_page_positions (view, pages, 3, 3,
0, 1, 2);
+
+ g_object_unref (view);
}
static gboolean
@@ -760,7 +798,7 @@ close_page_position_cb (AdwTabView *view,
static void
test_adw_tab_view_close_signal (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[10];
gulong handler;
@@ -801,12 +839,14 @@ test_adw_tab_view_close_signal (void)
2, 4, 5, 6, 8);
g_signal_handler_disconnect (view, handler);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_close_select (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *pages[14];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -873,13 +913,15 @@ test_adw_tab_view_close_select (void)
adw_tab_view_close_page (view, pages[12]);
g_assert_true (adw_tab_view_get_selected_page (view) == pages[1]);
+
+ g_object_unref (view);
}
static void
test_adw_tab_view_transfer (void)
{
- g_autoptr (AdwTabView) view1 = NULL;
- g_autoptr (AdwTabView) view2 = NULL;
+ AdwTabView *view1 = NULL;
+ AdwTabView *view2 = NULL;
AdwTabPage *pages1[4], *pages2[4];
view1 = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -909,13 +951,16 @@ test_adw_tab_view_transfer (void)
assert_page_positions (view2, pages2, 4, 3,
0, -1, 1, 2);
g_assert_true (adw_tab_view_get_nth_page (view1, 2) == pages2[3]);
+
+ g_object_unref (view2);
+ g_object_unref (view1);
}
static void
test_adw_tab_view_pages (void)
{
- g_autoptr (AdwTabView) view = NULL;
- g_autoptr (GtkSelectionModel) model = NULL;
+ AdwTabView *view = NULL;
+ GtkSelectionModel *model = NULL;
AdwTabPage *pages[2];
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
@@ -940,12 +985,15 @@ test_adw_tab_view_pages (void)
adw_tab_view_close_page (view, pages[1]);
g_signal_handlers_disconnect_by_func (model, G_CALLBACK (check_selection_null), view);
+
+ g_object_unref (model);
+ g_object_unref (view);
}
static void
test_adw_tab_page_title (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
const char *title;
@@ -970,12 +1018,14 @@ test_adw_tab_page_title (void)
g_object_set (page, "title", "Some other title", NULL);
g_assert_cmpstr (adw_tab_page_get_title (page), ==, "Some other title");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
}
static void
test_adw_tab_page_tooltip (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
const char *tooltip;
@@ -1000,16 +1050,18 @@ test_adw_tab_page_tooltip (void)
g_object_set (page, "tooltip", "Some other tooltip", NULL);
g_assert_cmpstr (adw_tab_page_get_tooltip (page), ==, "Some other tooltip");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
}
static void
test_adw_tab_page_icon (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
GIcon *icon = NULL;
- g_autoptr (GIcon) icon1 = g_themed_icon_new ("go-previous-symbolic");
- g_autoptr (GIcon) icon2 = g_themed_icon_new ("go-next-symbolic");
+ GIcon *icon1 = g_themed_icon_new ("go-previous-symbolic");
+ GIcon *icon2 = g_themed_icon_new ("go-next-symbolic");
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
g_assert_nonnull (view);
@@ -1032,12 +1084,16 @@ test_adw_tab_page_icon (void)
g_object_set (page, "icon", icon2, NULL);
g_assert_true (adw_tab_page_get_icon (page) == icon2);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
+ g_object_unref (icon2);
+ g_object_unref (icon1);
}
static void
test_adw_tab_page_loading (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
gboolean loading;
@@ -1062,16 +1118,18 @@ test_adw_tab_page_loading (void)
g_object_set (page, "loading", FALSE, NULL);
g_assert_false (adw_tab_page_get_loading (page));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
}
static void
test_adw_tab_page_indicator_icon (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
GIcon *icon = NULL;
- g_autoptr (GIcon) icon1 = g_themed_icon_new ("go-previous-symbolic");
- g_autoptr (GIcon) icon2 = g_themed_icon_new ("go-next-symbolic");
+ GIcon *icon1 = g_themed_icon_new ("go-previous-symbolic");
+ GIcon *icon2 = g_themed_icon_new ("go-next-symbolic");
view = g_object_ref_sink (ADW_TAB_VIEW (adw_tab_view_new ()));
g_assert_nonnull (view);
@@ -1094,12 +1152,16 @@ test_adw_tab_page_indicator_icon (void)
g_object_set (page, "indicator-icon", icon2, NULL);
g_assert_true (adw_tab_page_get_indicator_icon (page) == icon2);
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
+ g_object_unref (icon2);
+ g_object_unref (icon1);
}
static void
test_adw_tab_page_indicator_activatable (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
gboolean activatable;
@@ -1124,12 +1186,14 @@ test_adw_tab_page_indicator_activatable (void)
g_object_set (page, "indicator-activatable", FALSE, NULL);
g_assert_false (adw_tab_page_get_indicator_activatable (page));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
}
static void
test_adw_tab_page_needs_attention (void)
{
- g_autoptr (AdwTabView) view = NULL;
+ AdwTabView *view = NULL;
AdwTabPage *page;
gboolean needs_attention;
@@ -1154,6 +1218,8 @@ test_adw_tab_page_needs_attention (void)
g_object_set (page, "needs-attention", FALSE, NULL);
g_assert_false (adw_tab_page_get_needs_attention (page));
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (view);
}
static void
@@ -1193,9 +1259,9 @@ test_adw_tab_view_pages_to_list_view_unbind (GtkSignalListItemFactory *factory,
static void
test_adw_tab_view_pages_to_list_view (void)
{
- g_autoptr (AdwTabView) view = NULL;
- g_autoptr (GtkSelectionModel) pages = NULL;
- g_autoptr (GtkListView) list_view = NULL;
+ AdwTabView *view = NULL;
+ GtkSelectionModel *pages = NULL;
+ GtkListView *list_view = NULL;
GtkListItemFactory *factory;
GtkLabel *label;
@@ -1221,6 +1287,8 @@ test_adw_tab_view_pages_to_list_view (void)
adw_tab_view_append (view, GTK_WIDGET (label));
g_clear_object (&factory);
+ g_object_unref (pages);
+ g_object_unref (list_view);
}
int
diff --git a/tests/test-view-switcher-bar.c b/tests/test-view-switcher-bar.c
index e44ee5bd..19c4f647 100644
--- a/tests/test-view-switcher-bar.c
+++ b/tests/test-view-switcher-bar.c
@@ -10,7 +10,7 @@
static void
test_adw_view_switcher_bar_stack (void)
{
- g_autoptr (AdwViewSwitcherBar) bar = NULL;
+ AdwViewSwitcherBar *bar = NULL;
AdwViewStack *stack;
bar = g_object_ref_sink (ADW_VIEW_SWITCHER_BAR (adw_view_switcher_bar_new ()));
@@ -26,13 +26,15 @@ test_adw_view_switcher_bar_stack (void)
adw_view_switcher_bar_set_stack (bar, NULL);
g_assert_null (adw_view_switcher_bar_get_stack (bar));
+
+ g_object_unref (bar);
}
static void
test_adw_view_switcher_bar_reveal (void)
{
- g_autoptr (AdwViewSwitcherBar) bar = NULL;
+ AdwViewSwitcherBar *bar = NULL;
bar = g_object_ref_sink (ADW_VIEW_SWITCHER_BAR (adw_view_switcher_bar_new ()));
g_assert_nonnull (bar);
@@ -44,6 +46,8 @@ test_adw_view_switcher_bar_reveal (void)
adw_view_switcher_bar_set_reveal (bar, FALSE);
g_assert_false (adw_view_switcher_bar_get_reveal (bar));
+
+ g_object_unref (bar);
}
diff --git a/tests/test-view-switcher.c b/tests/test-view-switcher.c
index dafc5463..db75af6d 100644
--- a/tests/test-view-switcher.c
+++ b/tests/test-view-switcher.c
@@ -10,7 +10,7 @@
static void
test_adw_view_switcher_policy (void)
{
- g_autoptr (AdwViewSwitcher) view_switcher = NULL;
+ AdwViewSwitcher *view_switcher = NULL;
view_switcher = g_object_ref_sink (ADW_VIEW_SWITCHER (adw_view_switcher_new ()));
g_assert_nonnull (view_switcher);
@@ -22,13 +22,15 @@ test_adw_view_switcher_policy (void)
adw_view_switcher_set_policy (view_switcher, ADW_VIEW_SWITCHER_POLICY_NARROW);
g_assert_cmpint (adw_view_switcher_get_policy (view_switcher), ==, ADW_VIEW_SWITCHER_POLICY_NARROW);
+
+ g_object_unref (view_switcher);
}
static void
test_adw_view_switcher_stack (void)
{
- g_autoptr (AdwViewSwitcher) view_switcher = NULL;
+ AdwViewSwitcher *view_switcher = NULL;
AdwViewStack *stack;
view_switcher = g_object_ref_sink (ADW_VIEW_SWITCHER (adw_view_switcher_new ()));
@@ -44,6 +46,8 @@ test_adw_view_switcher_stack (void)
adw_view_switcher_set_stack (view_switcher, NULL);
g_assert_null (adw_view_switcher_get_stack (view_switcher));
+
+ g_object_unref (view_switcher);
}
diff --git a/tests/test-window-title.c b/tests/test-window-title.c
index 24c45cbe..8514e8ac 100644
--- a/tests/test-window-title.c
+++ b/tests/test-window-title.c
@@ -19,7 +19,7 @@ notify_cb (GtkWidget *widget, gpointer data)
static void
test_adw_window_title_title (void)
{
- g_autoptr (AdwWindowTitle) window_title = NULL;
+ AdwWindowTitle *window_title = NULL;
const char *title;
window_title = g_object_ref_sink (ADW_WINDOW_TITLE (adw_window_title_new ("Some title", NULL)));
@@ -41,12 +41,14 @@ test_adw_window_title_title (void)
g_object_set (window_title, "title", "Yet another title", NULL);
g_assert_cmpstr (adw_window_title_get_title (window_title), ==, "Yet another title");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (window_title);
}
static void
test_adw_window_title_subtitle (void)
{
- g_autoptr (AdwWindowTitle) window_title = NULL;
+ AdwWindowTitle *window_title = NULL;
const char *subtitle;
window_title = g_object_ref_sink (ADW_WINDOW_TITLE (adw_window_title_new (NULL, "Some subtitle")));
@@ -68,6 +70,8 @@ test_adw_window_title_subtitle (void)
g_object_set (window_title, "subtitle", "Yet another subtitle", NULL);
g_assert_cmpstr (adw_window_title_get_subtitle (window_title), ==, "Yet another subtitle");
g_assert_cmpint (notified, ==, 2);
+
+ g_object_unref (window_title);
}
int
diff --git a/tests/test-window.c b/tests/test-window.c
index 01a04354..648f10c9 100644
--- a/tests/test-window.c
+++ b/tests/test-window.c
@@ -10,10 +10,12 @@
static void
test_adw_window_new (void)
{
- g_autoptr (GtkWidget) window = NULL;
+ GtkWidget *window = NULL;
window = g_object_ref_sink (adw_window_new ());
g_assert_nonnull (window);
+
+ g_object_unref (window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]