telepathy-mission-control: mc-debug-server: don' t try to cope gracefully with a bad D-Bus connection
Simon McVittie
smcv at kemper.freedesktop.org
Thu Jan 30 04:34:41 PST 2014
Module: telepathy-mission-control
Branch: master
Commit: a58ba5a870d89f236ce529d2257e6a477ba4e876
URL: http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=a58ba5a870d89f236ce529d2257e6a477ba4e876
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Fri Nov 15 13:14:45 2013 +0000
mc-debug-server: don't try to cope gracefully with a bad D-Bus connection
We know the regression tests are going to provide fake system and
session buses.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
---
tests/twisted/mc-debug-server.c | 34 ++++++----------------------------
1 file changed, 6 insertions(+), 28 deletions(-)
diff --git a/tests/twisted/mc-debug-server.c b/tests/twisted/mc-debug-server.c
index 917a5d3..559f3f5 100644
--- a/tests/twisted/mc-debug-server.c
+++ b/tests/twisted/mc-debug-server.c
@@ -175,38 +175,18 @@ main (int argc, char **argv)
G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
gdbus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
-
- if (gdbus == NULL)
- {
- g_warning ("%s", error->message);
- g_error_free (error);
- error = NULL;
- goto out;
- }
-
+ g_assert_no_error (error);
+ g_assert (gdbus != NULL);
g_dbus_connection_set_exit_on_close (gdbus, FALSE);
gdbus_system = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
-
- if (gdbus_system == NULL)
- {
- g_warning ("%s", error->message);
- g_error_free (error);
- error = NULL;
- goto out;
- }
-
+ g_assert_no_error (error);
+ g_assert (gdbus_system != NULL);
g_dbus_connection_set_exit_on_close (gdbus_system, FALSE);
bus_daemon = tp_dbus_daemon_dup (&error);
-
- if (bus_daemon == NULL)
- {
- g_warning ("%s", error->message);
- g_error_free (error);
- error = NULL;
- goto out;
- }
+ g_assert_no_error (error);
+ g_assert (bus_daemon != NULL);
/* It appears that dbus-glib registers a filter that wrongly returns
* DBUS_HANDLER_RESULT_HANDLED for signals, so for *our* filter to have any
@@ -243,8 +223,6 @@ main (int argc, char **argv)
g_main_loop_run (teardown_loop);
-out:
-
if (connection != NULL)
{
dbus_connection_flush (connection);
More information about the telepathy-commits
mailing list