From 323c5d7e214b3baf289eaeda844bdf0d04cdfd0e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 21 Jun 2021 14:16:03 +0100 Subject: [PATCH] tests: Add some missing main context iterations to gdbus-names These were missing from the test before the previous commit ported from `GMainLoop` to `GMainContext`. Signed-off-by: Philip Withnall --- gio/tests/gdbus-names.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gio/tests/gdbus-names.c b/gio/tests/gdbus-names.c index 81f70f4eb..f20505f43 100644 --- a/gio/tests/gdbus-names.c +++ b/gio/tests/gdbus-names.c @@ -773,7 +773,11 @@ test_bus_watch_name (gconstpointer d) g_assert_cmpint (data.num_appeared, ==, 0); g_assert_cmpint (data.num_vanished, ==, 1); + g_bus_unwatch_name (id); + while (data.num_free_func < 1) + g_main_context_iteration (main_context, TRUE); + g_assert_cmpint (data.num_appeared, ==, 0); g_assert_cmpint (data.num_vanished, ==, 1); g_assert_cmpint (data.num_free_func, ==, 1); @@ -845,6 +849,9 @@ test_bus_watch_name (gconstpointer d) * Unwatch the name. */ g_bus_unwatch_name (id); + while (data.num_free_func < 1) + g_main_context_iteration (main_context, TRUE); + g_assert_cmpint (data.num_free_func, ==, 1); /* unown the name */ @@ -952,7 +959,11 @@ test_bus_watch_name (gconstpointer d) g_assert_cmpint (own_data.num_lost, ==, 0); g_assert_cmpint (data.num_vanished, ==, 1); } + g_bus_unwatch_name (id); + while (data.num_free_func < 1) + g_main_context_iteration (main_context, TRUE); + g_assert_cmpint (data.num_free_func, ==, 1); if (!watch_name_test->existing_service)