tests: Use G_SOURCE_CONTINUE/G_SOURCE_REMOVE instead of booleans

This makes no functional difference, but clarifies the code a little.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-06-17 18:31:45 +01:00
parent a956b096af
commit 5e49d53cd5

View File

@ -89,7 +89,7 @@ mock_operation_timeout (gpointer user_data)
g_test_message ("LOOP: %u stopped at %u", g_test_message ("LOOP: %u stopped at %u",
data->iterations_requested, iterations_done); data->iterations_requested, iterations_done);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return FALSE; /* don't call timeout again */ return G_SOURCE_REMOVE;
} }
else else
{ {
@ -97,7 +97,7 @@ mock_operation_timeout (gpointer user_data)
if (g_test_verbose ()) if (g_test_verbose ())
g_test_message ("LOOP: %u iteration %u", g_test_message ("LOOP: %u iteration %u",
data->iterations_requested, iterations_done + 1); data->iterations_requested, iterations_done + 1);
return TRUE; /* call timeout */ return G_SOURCE_CONTINUE;
} }
} }