tests: Use g_assert_*() in cancellable test rather than g_assert()

`g_assert()` is compiled out if `G_DISABLE_ASSERT` is defined, and
`g_assert_*()` gives more detailed failure messages.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-02-28 15:15:02 +00:00
parent 369626e310
commit 4093321c9a

View File

@ -138,7 +138,7 @@ mock_operation_finish (GAsyncResult *result,
MockOperationData *data; MockOperationData *data;
GTask *task; GTask *task;
g_assert (g_task_is_valid (result, NULL)); g_assert_true (g_task_is_valid (result, NULL));
/* This test expects the return value to be iterations_done even /* This test expects the return value to be iterations_done even
* when an error is set. * when an error is set.
@ -212,7 +212,7 @@ test_cancel_multiple_concurrent (void)
if (g_test_verbose ()) if (g_test_verbose ())
g_printerr ("CANCEL: %d operations\n", num_async_operations); g_printerr ("CANCEL: %d operations\n", num_async_operations);
g_cancellable_cancel (cancellable); g_cancellable_cancel (cancellable);
g_assert (g_cancellable_is_cancelled (cancellable)); g_assert_true (g_cancellable_is_cancelled (cancellable));
/* Wait for all operations to be cancelled */ /* Wait for all operations to be cancelled */
g_main_loop_run (loop); g_main_loop_run (loop);