[glib/wip/pwithnall/fix-pollable-test: 1/3] tests: Use g_assert_*() rather than g_assert() in pollable




commit ac322a1205eafc768b5a5566508b33d45b19a86c
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue May 31 12:57:46 2022 +0100

    tests: Use g_assert_*() rather than g_assert() in pollable
    
    It won’t get compiled out with `G_DISABLE_ASSERT`.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 gio/tests/pollable.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gio/tests/pollable.c b/gio/tests/pollable.c
index b2faea9848..c382cb9089 100644
--- a/gio/tests/pollable.c
+++ b/gio/tests/pollable.c
@@ -115,11 +115,11 @@ test_streams (void)
   GSource *poll_source;
   gboolean success = FALSE;
 
-  g_assert (g_pollable_input_stream_can_poll (in));
-  g_assert (g_pollable_output_stream_can_poll (G_POLLABLE_OUTPUT_STREAM (out)));
+  g_assert_true (g_pollable_input_stream_can_poll (in));
+  g_assert_true (g_pollable_output_stream_can_poll (G_POLLABLE_OUTPUT_STREAM (out)));
 
   readable = g_pollable_input_stream_is_readable (in);
-  g_assert (!readable);
+  g_assert_false (readable);
 
   nread = g_pollable_input_stream_read_nonblocking (in, buf, 1, NULL, &error);
   g_assert_cmpint (nread, ==, -1);
@@ -165,8 +165,8 @@ test_streams (void)
     in = G_POLLABLE_INPUT_STREAM (g_unix_input_stream_new (fd, FALSE)); \
     out = g_unix_output_stream_new (fd, FALSE);                         \
                                                                         \
-    g_assert (!g_pollable_input_stream_can_poll (in));                  \
-    g_assert (!g_pollable_output_stream_can_poll (                      \
+    g_assert_false (g_pollable_input_stream_can_poll (in));             \
+    g_assert_false (g_pollable_output_stream_can_poll (                 \
         G_POLLABLE_OUTPUT_STREAM (out)));                               \
                                                                         \
     g_clear_object (&in);                                               \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]