[glib: 2/3] tests: Use g_assert_*() rather than g_assert() in once
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/3] tests: Use g_assert_*() rather than g_assert() in once
- Date: Tue, 21 Jun 2022 11:36:57 +0000 (UTC)
commit c572d013a41124be8dbdbdca1f691cb93a375f81
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Jun 7 09:24:13 2022 +0100
tests: Use g_assert_*() rather than g_assert() in once
It won’t get compiled out with `G_DISABLE_ASSERT`.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/tests/once.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/tests/once.c b/glib/tests/once.c
index 4d6ddf97cf..d0aeccb74f 100644
--- a/glib/tests/once.c
+++ b/glib/tests/once.c
@@ -48,12 +48,12 @@ test_once_single_threaded (void)
g_test_summary ("Test g_once() usage from a single thread");
- g_assert (once.status == G_ONCE_STATUS_NOTCALLED);
+ g_assert_cmpint (once.status, ==, G_ONCE_STATUS_NOTCALLED);
res = g_once (&once, do_once, NULL);
g_assert_cmpint (GPOINTER_TO_INT (res), ==, 1);
- g_assert (once.status == G_ONCE_STATUS_READY);
+ g_assert_cmpint (once.status, ==, G_ONCE_STATUS_READY);
res = g_once (&once, do_once, NULL);
g_assert_cmpint (GPOINTER_TO_INT (res), ==, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]