mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
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:
parent
51a135a272
commit
500d065f3d
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user