[glib: 2/5] tests: Use g_assert_*() rather than g_assert() in gdbus-connection-flush.c




commit 693e4efebacc2478b7543cc045e0eafefee303cb
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Feb 18 13:22:16 2022 +0000

    tests: Use g_assert_*() rather than g_assert() in gdbus-connection-flush.c
    
    `g_assert()` is compiled out with `G_DISABLE_ASSERT`.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 gio/tests/gdbus-connection-flush.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/gio/tests/gdbus-connection-flush.c b/gio/tests/gdbus-connection-flush.c
index 8c925825a..c1bdd37bb 100644
--- a/gio/tests/gdbus-connection-flush.c
+++ b/gio/tests/gdbus-connection-flush.c
@@ -179,8 +179,8 @@ setup_client_cb (GObject      *source,
 
   f->client_conn = g_dbus_connection_new_finish (res, &f->error);
   g_assert_no_error (f->error);
-  g_assert (G_IS_DBUS_CONNECTION (f->client_conn));
-  g_assert (f->client_conn == G_DBUS_CONNECTION (source));
+  g_assert_true (G_IS_DBUS_CONNECTION (f->client_conn));
+  g_assert_true (f->client_conn == G_DBUS_CONNECTION (source));
 }
 
 static void
@@ -192,8 +192,8 @@ setup_server_cb (GObject      *source,
 
   f->server_conn = g_dbus_connection_new_finish (res, &f->error);
   g_assert_no_error (f->error);
-  g_assert (G_IS_DBUS_CONNECTION (f->server_conn));
-  g_assert (f->server_conn == G_DBUS_CONNECTION (source));
+  g_assert_true (G_IS_DBUS_CONNECTION (f->server_conn));
+  g_assert_true (f->server_conn == G_DBUS_CONNECTION (source));
 }
 
 static void
@@ -206,21 +206,21 @@ setup (Fixture       *f,
 
   ok = test_pipe (&f->server_istream, &f->client_real_ostream, &f->error);
   g_assert_no_error (f->error);
-  g_assert (G_IS_OUTPUT_STREAM (f->client_real_ostream));
-  g_assert (G_IS_INPUT_STREAM (f->server_istream));
-  g_assert (ok);
+  g_assert_true (G_IS_OUTPUT_STREAM (f->client_real_ostream));
+  g_assert_true (G_IS_INPUT_STREAM (f->server_istream));
+  g_assert_true (ok);
 
   f->client_ostream = g_object_new (MY_TYPE_OUTPUT_STREAM,
                                     "base-stream", f->client_real_ostream,
                                     "close-base-stream", TRUE,
                                     NULL);
-  g_assert (G_IS_OUTPUT_STREAM (f->client_ostream));
+  g_assert_true (G_IS_OUTPUT_STREAM (f->client_ostream));
 
   ok = test_pipe (&f->client_istream, &f->server_ostream, &f->error);
   g_assert_no_error (f->error);
-  g_assert (G_IS_OUTPUT_STREAM (f->server_ostream));
-  g_assert (G_IS_INPUT_STREAM (f->client_istream));
-  g_assert (ok);
+  g_assert_true (G_IS_OUTPUT_STREAM (f->server_ostream));
+  g_assert_true (G_IS_INPUT_STREAM (f->client_istream));
+  g_assert_true (ok);
 
   f->client_stream = test_io_stream_new (f->client_istream, f->client_ostream);
   f->server_stream = test_io_stream_new (f->server_istream, f->server_ostream);
@@ -244,13 +244,13 @@ flush_cb (GObject      *source,
   Fixture *f = user_data;
   gboolean ok;
 
-  g_assert (G_IS_DBUS_CONNECTION (source));
-  g_assert (G_IS_DBUS_CONNECTION (f->client_conn));
+  g_assert_true (G_IS_DBUS_CONNECTION (source));
+  g_assert_true (G_IS_DBUS_CONNECTION (f->client_conn));
   g_assert_cmpuint ((guintptr) f->client_conn, ==, (guintptr) G_DBUS_CONNECTION (source));
 
   ok = g_dbus_connection_flush_finish (f->client_conn, res, &f->error);
   g_assert_no_error (f->error);
-  g_assert (ok);
+  g_assert_true (ok);
 
   f->flushed = TRUE;
 }
@@ -270,7 +270,7 @@ test_flush_busy (Fixture       *f,
                                       "com.example.Foo", "SomeSignal", NULL,
                                       &f->error);
   g_assert_no_error (f->error);
-  g_assert (ok);
+  g_assert_true (ok);
 
   /* wait for at least part of the message to have started writing -
    * the write will block indefinitely in the worker thread
@@ -318,7 +318,7 @@ test_flush_idle (Fixture       *f,
                                       "com.example.Foo", "SomeSignal", NULL,
                                       &f->error);
   g_assert_no_error (f->error);
-  g_assert (ok);
+  g_assert_true (ok);
 
   /* wait for at least part of the message to have been written */
   do {


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