diff options
author | Simon McVittie <smcv@collabora.com> | 2017-11-21 12:01:23 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2017-11-24 12:19:09 +0000 |
commit | 122e26e1a8c44a18fb8edfc86a65f13f15963b9b (patch) | |
tree | 2c31092ff81de9da755a542b627dda62f12d8ef7 | |
parent | e9d38b3fcbb8d06b52a906dfb72280368a48283e (diff) |
tests: Don't leak pending calls
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600
-rw-r--r-- | test/sd-activation.c | 9 | ||||
-rw-r--r-- | test/uid-permissions.c | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/sd-activation.c b/test/sd-activation.c index 8e0b2af6e..92203b70b 100644 --- a/test/sd-activation.c +++ b/test/sd-activation.c @@ -563,6 +563,8 @@ test_uae (Fixture *f, assert_method_reply (m, DBUS_SERVICE_DBUS, f->caller_name, ""); dbus_message_unref (m); + dbus_clear_pending_call (&pc); + /* The fake systemd connects to the bus. */ f->systemd = test_connect_to_bus (f->ctx, f->address); if (!dbus_connection_add_filter (f->systemd, systemd_filter, f, NULL)) @@ -648,6 +650,8 @@ test_uae (Fixture *f, assert_method_reply (m, DBUS_SERVICE_DBUS, f->caller_name, ""); dbus_message_unref (m); + dbus_clear_pending_call (&pc); + while (f->systemd_message == NULL) test_main_context_iterate (f->ctx, TRUE); @@ -897,6 +901,7 @@ test_transient_services (Fixture *f, assert_error_reply (m, DBUS_SERVICE_DBUS, f->caller_name, DBUS_ERROR_SERVICE_UNKNOWN); + dbus_clear_pending_call (&pc); dbus_message_unref (m); m = NULL; @@ -930,6 +935,8 @@ test_transient_services (Fixture *f, assert_method_reply (m, DBUS_SERVICE_DBUS, f->caller_name, ""); dbus_message_unref (m); m = NULL; + + dbus_clear_pending_call (&pc); } /* The service is present now. */ @@ -950,6 +957,8 @@ test_transient_services (Fixture *f, &reply, NULL)) g_error ("OOM"); + dbus_clear_pending_call (&pc); + /* The mock systemd is told to start the service. */ while (f->systemd_message == NULL) test_main_context_iterate (f->ctx, TRUE); diff --git a/test/uid-permissions.c b/test/uid-permissions.c index 75bbb13fb..ce6d7a6b2 100644 --- a/test/uid-permissions.c +++ b/test/uid-permissions.c @@ -145,6 +145,7 @@ test_uae (Fixture *f, g_assert_cmpstr (dbus_message_get_signature (m), ==, "s"); } + dbus_clear_pending_call (&pc); dbus_message_unref (m); } @@ -210,6 +211,7 @@ test_monitor (Fixture *f, g_assert_cmpstr (dbus_message_get_signature (m), ==, "s"); } + dbus_clear_pending_call (&pc); dbus_message_unref (m); } |