Commit 28d1c100 authored by Philip Withnall's avatar Philip Withnall
Browse files

tests: Use G_SOURCE_[CONTINUE|REMOVE] instead of booleans

Makes the test code a little clearer. Introduces no functional changes.
parent 8afd815d
...@@ -916,7 +916,7 @@ read_stream_cb (GObject *pollable_stream, gpointer _user_data) ...@@ -916,7 +916,7 @@ read_stream_cb (GObject *pollable_stream, gpointer _user_data)
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK);
g_error_free (error); g_error_free (error);
g_free (buf); g_free (buf);
return TRUE; return G_SOURCE_CONTINUE;
} }
g_assert_no_error (error); g_assert_no_error (error);
...@@ -928,10 +928,10 @@ read_stream_cb (GObject *pollable_stream, gpointer _user_data) ...@@ -928,10 +928,10 @@ read_stream_cb (GObject *pollable_stream, gpointer _user_data)
/* Termination time? */ /* Termination time? */
if (test_data->received_bytes == test_data->n_bytes) { if (test_data->received_bytes == test_data->n_bytes) {
g_main_loop_quit (gsource_data->main_loop); g_main_loop_quit (gsource_data->main_loop);
return FALSE; return G_SOURCE_REMOVE;
} }
return TRUE; return G_SOURCE_CONTINUE;
} }
static void static void
...@@ -994,7 +994,7 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data) ...@@ -994,7 +994,7 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data)
if (len == -1) { if (len == -1) {
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK);
g_free (buf); g_free (buf);
return TRUE; return G_SOURCE_CONTINUE;
} }
g_assert_no_error (error); g_assert_no_error (error);
...@@ -1006,10 +1006,10 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data) ...@@ -1006,10 +1006,10 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data)
/* Termination time? */ /* Termination time? */
if (test_data->transmitted_bytes == test_data->n_bytes) { if (test_data->transmitted_bytes == test_data->n_bytes) {
g_main_loop_quit (gsource_data->main_loop); g_main_loop_quit (gsource_data->main_loop);
return FALSE; return G_SOURCE_REMOVE;
} }
return TRUE; return G_SOURCE_CONTINUE;
} }
static void static void
......
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