[glib-networking/mcatanzaro/test-context: 2/2] Consistently use the test main context in connection tests




commit 31e6e1bb70a6adb217be5149e921aa1dbb9e85f0
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed May 26 09:22:44 2021 -0500

    Consistently use the test main context in connection tests
    
    It's a little bit nicer to say "iterate the main context of the current
    test" rather than "iterate the default main context." This doesn't
    actually change anything, because test->context is always the default
    main context, and NULL means "use the default main context." This is
    just a readability/style improvement, matching the changes proposed for
    DTLS in !155.

 tls/tests/connection.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 036df04..f2d1b7c 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -115,7 +115,7 @@ setup_connection (TestConnection *test, gconstpointer data)
       for (i = 0; i < 13 && (var); i++)                      \
         {                                                    \
           g_usleep (1000 * (1 << i));                        \
-          g_main_context_iteration (NULL, FALSE);            \
+          g_main_context_iteration (test->context, FALSE);   \
         }                                                    \
                                                              \
       g_assert_true (!(var));                                \
@@ -1988,7 +1988,7 @@ test_simultaneous_sync (TestConnection *test,
    * receive the connection and spawn the server thread.
    */
   while (!test->server_connection)
-    g_main_context_iteration (NULL, FALSE);
+    g_main_context_iteration (test->context, FALSE);
 
   g_thread_join (write_thread);
   g_thread_join (read_thread);
@@ -2251,7 +2251,7 @@ test_output_stream_close (TestConnection *test,
                                     handshake_completed, &handshake_complete);
 
   while (!handshake_complete)
-    g_main_context_iteration (NULL, TRUE);
+    g_main_context_iteration (test->context, TRUE);
 
   ret = g_output_stream_close (g_io_stream_get_output_stream (test->client_connection),
                                NULL, &error);


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