Commit 3cb67088 authored by Guido Gunther's avatar Guido Gunther
Browse files

tests: Drain event loop in shell test

This make sure there's no lingering async/idle callbacks
of disposed objects.
Signed-off-by: Guido Gunther's avatarGuido Günther <>
parent c5a49ac7
Pipeline #67442 passed with stages
in 34 minutes and 53 seconds
......@@ -53,6 +53,7 @@ test_shell_new (Fixture *fixture, gconstpointer unused)
PhoshShell *shell = NULL;
GLogLevelFlags flags;
gboolean success;
GMainLoop *loop;
gtk_init (NULL, NULL);
hdy_init ();
......@@ -74,10 +75,18 @@ test_shell_new (Fixture *fixture, gconstpointer unused)
g_idle_add (on_idle, &success);
gtk_main ();
/* No warnings allowed from here on */
g_log_set_always_fatal (flags);
g_assert_true (success);
g_object_unref (shell);
g_debug ("Finalizing shell");
g_assert_finalize_object (shell);
/* Process all pending events to spot missing cleanups */
loop = g_main_loop_new (NULL, FALSE);
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, FALSE);
g_main_loop_unref (loop);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment