[glib-networking] tests: consistently use the client main context in DTLS tests



commit 28f5961b672f3afc4367aeabe3ef19278d4621fc
Author: Ole André Vadla Ravnås <oleavr gmail com>
Date:   Thu May 27 00:43:02 2021 +0200

    tests: consistently use the client main context in DTLS tests
    
    Even if it happens to be the default main context, we should be explicit
    about it.

 tls/tests/dtls-connection.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/tls/tests/dtls-connection.c b/tls/tests/dtls-connection.c
index 2ccd058..999f3e3 100644
--- a/tls/tests/dtls-connection.c
+++ b/tls/tests/dtls-connection.c
@@ -105,18 +105,18 @@ setup_connection (TestConnection *test, gconstpointer data)
 }
 
 /* Waits about 10 seconds for @var to be NULL/FALSE */
-#define WAIT_UNTIL_UNSET(var)                             \
-  if (var)                                                \
-    {                                                     \
-      int i;                                              \
-                                                          \
-      for (i = 0; i < 13 && (var); i++)                   \
-        {                                                 \
-          g_usleep (1000 * (1 << i));                     \
-          g_main_context_iteration (NULL, FALSE);         \
-        }                                                 \
-                                                          \
-      g_assert_true (!(var));                             \
+#define WAIT_UNTIL_UNSET(var)                                     \
+  if (var)                                                        \
+    {                                                             \
+      int i;                                                      \
+                                                                  \
+      for (i = 0; i < 13 && (var); i++)                           \
+        {                                                         \
+          g_usleep (1000 * (1 << i));                             \
+          g_main_context_iteration (test->client_context, FALSE); \
+        }                                                         \
+                                                                  \
+      g_assert_true (!(var));                                     \
     }
 
 /* Waits about 10 seconds for @var's ref_count to drop to 1 */
@@ -637,7 +637,7 @@ read_test_data_async (TestConnection *test)
                                                   G_SOCKET_MSG_NONE,
                                                   test->test_data->client_timeout,
                                                   NULL, &test->read_error);
-      g_main_context_iteration (NULL, FALSE);
+      g_main_context_iteration (test->client_context, FALSE);
     }
   while (g_error_matches (test->read_error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK));
 


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