From 500d065f3d0e14fdb4211a2b598502d04a6ece6c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 3 Aug 2020 15:53:12 +0100 Subject: [PATCH] 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 --- gio/tests/gdbus-auth.c | 2 +- gio/tests/gdbus-close-pending.c | 2 +- gio/tests/gdbus-connection-loss.c | 2 +- gio/tests/gdbus-connection-slow.c | 4 ++-- gio/tests/gdbus-connection.c | 4 ++-- gio/tests/gdbus-example-server.c | 2 +- gio/tests/gdbus-exit-on-close.c | 2 +- gio/tests/gdbus-overflow.c | 2 +- gio/tests/gdbus-peer.c | 6 +++--- gio/tests/gdbus-tests.c | 6 +++--- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gio/tests/gdbus-auth.c b/gio/tests/gdbus-auth.c index 8be4473c7..18288f36d 100644 --- a/gio/tests/gdbus-auth.c +++ b/gio/tests/gdbus-auth.c @@ -121,7 +121,7 @@ test_auth_on_timeout (gpointer user_data) { g_error ("Timeout waiting for client"); g_assert_not_reached (); - return FALSE; + return G_SOURCE_REMOVE; } diff --git a/gio/tests/gdbus-close-pending.c b/gio/tests/gdbus-close-pending.c index d2c5b62f5..bd8fda5a7 100644 --- a/gio/tests/gdbus-close-pending.c +++ b/gio/tests/gdbus-close-pending.c @@ -188,7 +188,7 @@ delayed_close_cb (gpointer data) close_async (df->stream, df->io_priority, df->cancellable, df->callback, df->user_data); - return FALSE; + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-connection-loss.c b/gio/tests/gdbus-connection-loss.c index a34a9923c..cc88cb0cc 100644 --- a/gio/tests/gdbus-connection-loss.c +++ b/gio/tests/gdbus-connection-loss.c @@ -53,7 +53,7 @@ on_timeout (gpointer user_data) { /* tear down bus */ session_bus_stop (); - return FALSE; /* remove source */ + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-connection-slow.c b/gio/tests/gdbus-connection-slow.c index dd1ababd4..27a6af3c4 100644 --- a/gio/tests/gdbus-connection-slow.c +++ b/gio/tests/gdbus-connection-slow.c @@ -49,7 +49,7 @@ test_connection_flush_on_timeout (gpointer user_data) guint iteration = GPOINTER_TO_UINT (user_data); g_printerr ("Timeout waiting 1000 msec on iteration %d\n", iteration); g_assert_not_reached (); - return FALSE; + return G_SOURCE_REMOVE; } static void @@ -125,7 +125,7 @@ large_message_timeout_cb (gpointer data) g_error ("Error: timeout waiting for dbus name to appear"); - return FALSE; + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-connection.c b/gio/tests/gdbus-connection.c index 7bd7a02f4..278570609 100644 --- a/gio/tests/gdbus-connection.c +++ b/gio/tests/gdbus-connection.c @@ -65,7 +65,7 @@ test_connection_quit_mainloop (gpointer user_data) _log ("quit_mainloop_fired"); *quit_mainloop_fired = TRUE; 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_assert_not_reached (); - return FALSE; + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-example-server.c b/gio/tests/gdbus-example-server.c index 6f1123d85..00e482724 100644 --- a/gio/tests/gdbus-example-server.c +++ b/gio/tests/gdbus-example-server.c @@ -315,7 +315,7 @@ on_timeout_cb (gpointer user_data) g_assert_no_error (error); - return TRUE; + return G_SOURCE_CONTINUE; } /* ---------------------------------------------------------------------------------------------------- */ diff --git a/gio/tests/gdbus-exit-on-close.c b/gio/tests/gdbus-exit-on-close.c index 3c4e5ecd6..4241fc7a4 100644 --- a/gio/tests/gdbus-exit-on-close.c +++ b/gio/tests/gdbus-exit-on-close.c @@ -57,7 +57,7 @@ quit_later_cb (gpointer data G_GNUC_UNUSED) { g_main_loop_quit (loop); - return FALSE; + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-overflow.c b/gio/tests/gdbus-overflow.c index 53ec9c0b6..ca3d5d0e7 100644 --- a/gio/tests/gdbus-overflow.c +++ b/gio/tests/gdbus-overflow.c @@ -95,7 +95,7 @@ static gboolean overflow_on_500ms_later_func (gpointer user_data) { g_main_loop_quit (loop); - return FALSE; /* don't keep the idle */ + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c index 617d7561a..008e3fc81 100644 --- a/gio/tests/gdbus-peer.c +++ b/gio/tests/gdbus-peer.c @@ -644,7 +644,7 @@ check_connection (gpointer user_data) } } - return FALSE; + return G_SOURCE_REMOVE; } 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_dbus_connection_disconnect (c); g_object_unref (c); - return FALSE; + return G_SOURCE_REMOVE; } #endif @@ -1794,7 +1794,7 @@ static gboolean codegen_quit_mainloop_timeout (gpointer data) { g_main_loop_quit (loop); - return FALSE; + return G_SOURCE_REMOVE; } static void diff --git a/gio/tests/gdbus-tests.c b/gio/tests/gdbus-tests.c index bed0d24f7..1003d07e0 100644 --- a/gio/tests/gdbus-tests.c +++ b/gio/tests/gdbus-tests.c @@ -48,7 +48,7 @@ on_property_notify_timeout (gpointer user_data) PropertyNotifyData *data = user_data; data->timed_out = TRUE; g_main_loop_quit (data->loop); - return TRUE; + return G_SOURCE_CONTINUE; } gboolean @@ -83,7 +83,7 @@ static gboolean _give_up (gpointer data) { g_error ("%s", (const gchar *) data); - g_return_val_if_reached (TRUE); + g_return_val_if_reached (G_SOURCE_CONTINUE); } typedef struct @@ -175,7 +175,7 @@ on_signal_received_timeout (gpointer user_data) SignalReceivedData *data = user_data; data->timed_out = TRUE; g_main_loop_quit (data->loop); - return TRUE; + return G_SOURCE_CONTINUE; } gboolean