GDBus tests: Use G_SOURCE_REMOVE, G_SOURCE_CONTINUE

The meaning of the boolean result of a GSource function is clearer if
we use these aliases.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2020-08-03 15:53:12 +01:00 committed by Philip Withnall
parent 51a135a272
commit 500d065f3d
10 changed files with 16 additions and 16 deletions

View File

@ -121,7 +121,7 @@ test_auth_on_timeout (gpointer user_data)
{ {
g_error ("Timeout waiting for client"); g_error ("Timeout waiting for client");
g_assert_not_reached (); g_assert_not_reached ();
return FALSE; return G_SOURCE_REMOVE;
} }

View File

@ -188,7 +188,7 @@ delayed_close_cb (gpointer data)
close_async (df->stream, df->io_priority, df->cancellable, df->callback, close_async (df->stream, df->io_priority, df->cancellable, df->callback,
df->user_data); df->user_data);
return FALSE; return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -53,7 +53,7 @@ on_timeout (gpointer user_data)
{ {
/* tear down bus */ /* tear down bus */
session_bus_stop (); session_bus_stop ();
return FALSE; /* remove source */ return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -49,7 +49,7 @@ test_connection_flush_on_timeout (gpointer user_data)
guint iteration = GPOINTER_TO_UINT (user_data); guint iteration = GPOINTER_TO_UINT (user_data);
g_printerr ("Timeout waiting 1000 msec on iteration %d\n", iteration); g_printerr ("Timeout waiting 1000 msec on iteration %d\n", iteration);
g_assert_not_reached (); g_assert_not_reached ();
return FALSE; return G_SOURCE_REMOVE;
} }
static void static void
@ -125,7 +125,7 @@ large_message_timeout_cb (gpointer data)
g_error ("Error: timeout waiting for dbus name to appear"); g_error ("Error: timeout waiting for dbus name to appear");
return FALSE; return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -65,7 +65,7 @@ test_connection_quit_mainloop (gpointer user_data)
_log ("quit_mainloop_fired"); _log ("quit_mainloop_fired");
*quit_mainloop_fired = TRUE; *quit_mainloop_fired = TRUE;
g_main_loop_quit (loop); g_main_loop_quit (loop);
return TRUE; return G_SOURCE_CONTINUE;
} }
/* ---------------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------------- */
@ -934,7 +934,7 @@ test_connection_filter_on_timeout (gpointer user_data)
{ {
g_printerr ("Timeout waiting 30 sec on service\n"); g_printerr ("Timeout waiting 30 sec on service\n");
g_assert_not_reached (); g_assert_not_reached ();
return FALSE; return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -315,7 +315,7 @@ on_timeout_cb (gpointer user_data)
g_assert_no_error (error); g_assert_no_error (error);
return TRUE; return G_SOURCE_CONTINUE;
} }
/* ---------------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------------- */

View File

@ -57,7 +57,7 @@ quit_later_cb (gpointer data G_GNUC_UNUSED)
{ {
g_main_loop_quit (loop); g_main_loop_quit (loop);
return FALSE; return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -95,7 +95,7 @@ static gboolean
overflow_on_500ms_later_func (gpointer user_data) overflow_on_500ms_later_func (gpointer user_data)
{ {
g_main_loop_quit (loop); g_main_loop_quit (loop);
return FALSE; /* don't keep the idle */ return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -644,7 +644,7 @@ check_connection (gpointer user_data)
} }
} }
return FALSE; return G_SOURCE_REMOVE;
} }
static gboolean static gboolean
@ -654,7 +654,7 @@ on_do_disconnect_in_idle (gpointer data)
g_debug ("GDC %p has ref_count %d", c, G_OBJECT (c)->ref_count); g_debug ("GDC %p has ref_count %d", c, G_OBJECT (c)->ref_count);
g_dbus_connection_disconnect (c); g_dbus_connection_disconnect (c);
g_object_unref (c); g_object_unref (c);
return FALSE; return G_SOURCE_REMOVE;
} }
#endif #endif
@ -1794,7 +1794,7 @@ static gboolean
codegen_quit_mainloop_timeout (gpointer data) codegen_quit_mainloop_timeout (gpointer data)
{ {
g_main_loop_quit (loop); g_main_loop_quit (loop);
return FALSE; return G_SOURCE_REMOVE;
} }
static void static void

View File

@ -48,7 +48,7 @@ on_property_notify_timeout (gpointer user_data)
PropertyNotifyData *data = user_data; PropertyNotifyData *data = user_data;
data->timed_out = TRUE; data->timed_out = TRUE;
g_main_loop_quit (data->loop); g_main_loop_quit (data->loop);
return TRUE; return G_SOURCE_CONTINUE;
} }
gboolean gboolean
@ -83,7 +83,7 @@ static gboolean
_give_up (gpointer data) _give_up (gpointer data)
{ {
g_error ("%s", (const gchar *) data); g_error ("%s", (const gchar *) data);
g_return_val_if_reached (TRUE); g_return_val_if_reached (G_SOURCE_CONTINUE);
} }
typedef struct typedef struct
@ -175,7 +175,7 @@ on_signal_received_timeout (gpointer user_data)
SignalReceivedData *data = user_data; SignalReceivedData *data = user_data;
data->timed_out = TRUE; data->timed_out = TRUE;
g_main_loop_quit (data->loop); g_main_loop_quit (data->loop);
return TRUE; return G_SOURCE_CONTINUE;
} }
gboolean gboolean