summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-15 13:14:45 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-01-29 19:28:31 +0000
commita58ba5a870d89f236ce529d2257e6a477ba4e876 (patch)
treecc728375f900271fa0ab266de1c8e87704d0f0c0 /tests
parentf97f287ae9ad702a9300720b441c6cfc3915878a (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/mc-debug-server.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/tests/twisted/mc-debug-server.c b/tests/twisted/mc-debug-server.c
index 917a5d34..559f3f58 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);