tests: Don't leak profiles and test that

We finalize the theme first so the last reference is dropped when
finalizing the profiles.
This commit is contained in:
Guido Günther
2023-03-13 15:26:07 +01:00
parent 460985cfa0
commit 1933a23172
+5 -1
View File
@@ -36,7 +36,7 @@ test_fbd_feedback_theme_profiles (void)
g_autoptr (FbdFeedbackDummy) full_fb2 = g_object_new (FBD_TYPE_FEEDBACK_DUMMY, g_autoptr (FbdFeedbackDummy) full_fb2 = g_object_new (FBD_TYPE_FEEDBACK_DUMMY,
"event-name", "event2", "event-name", "event2",
NULL); NULL);
g_autoptr(FbdFeedbackTheme) theme = fbd_feedback_theme_new (THEME_NAME); FbdFeedbackTheme *theme = fbd_feedback_theme_new (THEME_NAME);
FbdFeedbackProfile *profile_full = fbd_feedback_profile_new ("full"); FbdFeedbackProfile *profile_full = fbd_feedback_profile_new ("full");
FbdFeedbackProfile *profile_quiet = fbd_feedback_profile_new ("quiet"); FbdFeedbackProfile *profile_quiet = fbd_feedback_profile_new ("quiet");
FbdFeedbackProfile *profile; FbdFeedbackProfile *profile;
@@ -57,6 +57,10 @@ test_fbd_feedback_theme_profiles (void)
json = json_gobject_to_data (G_OBJECT(theme), NULL); json = json_gobject_to_data (G_OBJECT(theme), NULL);
g_print ("%s\n", json); g_print ("%s\n", json);
g_assert_finalize_object (theme);
g_assert_finalize_object (profile_full);
g_assert_finalize_object (profile_quiet);
} }