From 9db8765e214270a1f14bac09379b56d4d1b0f417 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 1 Jun 2023 11:40:18 +0100 Subject: [PATCH] tests: Use g_assert_*() rather than g_assert() in rec-mutex tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It won’t get compiled out with `G_DISABLE_ASSERT`. Signed-off-by: Philip Withnall --- glib/tests/rec-mutex.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/glib/tests/rec-mutex.c b/glib/tests/rec-mutex.c index ad38a69a8..612cd8549 100644 --- a/glib/tests/rec-mutex.c +++ b/glib/tests/rec-mutex.c @@ -62,10 +62,10 @@ test_rec_mutex3 (void) gboolean ret; ret = g_rec_mutex_trylock (&mutex); - g_assert (ret); + g_assert_true (ret); ret = g_rec_mutex_trylock (&mutex); - g_assert (ret); + g_assert_true (ret); g_rec_mutex_unlock (&mutex); g_rec_mutex_unlock (&mutex); @@ -94,28 +94,28 @@ acquire (gint nr) g_rec_mutex_lock (&locks[nr]); } - g_assert (owners[nr] == NULL); /* hopefully nobody else is here */ + g_assert_null (owners[nr]); /* hopefully nobody else is here */ owners[nr] = self; /* let some other threads try to ruin our day */ g_thread_yield (); g_thread_yield (); - g_assert (owners[nr] == self); /* hopefully this is still us... */ + g_assert_true (owners[nr] == self); /* hopefully this is still us... */ if (g_test_verbose ()) g_printerr ("thread %p recursively taking lock %d\n", self, nr); g_rec_mutex_lock (&locks[nr]); /* we're recursive, after all */ - g_assert (owners[nr] == self); /* hopefully this is still us... */ + g_assert_true (owners[nr] == self); /* hopefully this is still us... */ g_rec_mutex_unlock (&locks[nr]); g_thread_yield (); g_thread_yield (); - g_assert (owners[nr] == self); /* hopefully this is still us... */ + g_assert_true (owners[nr] == self); /* hopefully this is still us... */ owners[nr] = NULL; /* make way for the next guy */ g_rec_mutex_unlock (&locks[nr]); @@ -156,7 +156,7 @@ test_rec_mutex4 (void) g_rec_mutex_clear (&locks[i]); for (i = 0; i < LOCKS; i++) - g_assert (owners[i] == NULL); + g_assert_null (owners[i]); } static gint count_to = 0;