[glib: 1/3] tests: Add a test for g_dbus_connection_get_flags()



commit a01983f94cc0c4e75e1ed19f994e31d52efef69d
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Aug 21 19:47:38 2019 +0300

    tests: Add a test for g_dbus_connection_get_flags()
    
    It was added in !554 but never had a unit test.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Helps: #1620

 gio/tests/gdbus-connection.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gio/tests/gdbus-connection.c b/gio/tests/gdbus-connection.c
index 35593be9f..6e4c7eb05 100644
--- a/gio/tests/gdbus-connection.c
+++ b/gio/tests/gdbus-connection.c
@@ -1197,6 +1197,7 @@ test_connection_basic (void)
   GDBusConnection *connection;
   GError *error;
   GDBusCapabilityFlags flags;
+  GDBusConnectionFlags connection_flags;
   gchar *guid;
   gchar *name;
   gboolean closed;
@@ -1215,6 +1216,11 @@ test_connection_basic (void)
   g_assert (flags == G_DBUS_CAPABILITY_FLAGS_NONE ||
             flags == G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
 
+  connection_flags = g_dbus_connection_get_flags (connection);
+  g_assert_cmpint (connection_flags, ==,
+                   G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT |
+                   G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION);
+
   credentials = g_dbus_connection_get_peer_credentials (connection);
   g_assert (credentials == NULL);
 


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