[glib: 1/2] gio/tests/desktop-app-info: Wait until the callback is called




commit ecaa5b5b7abcf7b15d5ff7e2672b8bd1314541a5
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Jul 12 17:18:52 2022 +0200

    gio/tests/desktop-app-info: Wait until the callback is called
    
    The test was flacky because we were only relying on the presence of a
    file, while the callback could have not been called yet, while ensure
    for both assumptions to be true before stop iterating the loop.

 gio/tests/desktop-app-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c
index 2bcdba7cf0..6d3f4e853c 100644
--- a/gio/tests/desktop-app-info.c
+++ b/gio/tests/desktop-app-info.c
@@ -1118,7 +1118,7 @@ test_default_uri_handler_async (void)
                                            on_launch_default_for_uri_success_cb,
                                            &called);
 
-  while (!g_file_test (file_path, G_FILE_TEST_IS_REGULAR))
+  while (!g_file_test (file_path, G_FILE_TEST_IS_REGULAR) || !called)
     g_main_context_iteration (NULL, FALSE);
 
   g_assert_true (called);


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