diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-25 12:34:38 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-25 17:38:21 +0100 |
commit | 2bfac1b73d7aa1524452a16ff85a025c61883f8a (patch) | |
tree | 60953d89e1a4dd09d36b1c85a60231f436cd1baa /test/name-test | |
parent | 0092a75153a0fd9d028aec33ddbef7fd0a4a1f32 (diff) | |
download | dbus-2bfac1b73d7aa1524452a16ff85a025c61883f8a.tar.gz dbus-2bfac1b73d7aa1524452a16ff85a025c61883f8a.tar.bz2 dbus-2bfac1b73d7aa1524452a16ff85a025c61883f8a.zip |
test-autolaunch: don't expect autolaunching to work if X11 is disabled
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997
Reviewed-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'test/name-test')
-rw-r--r-- | test/name-test/test-autolaunch.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/name-test/test-autolaunch.c b/test/name-test/test-autolaunch.c index d3f42e35..d50dfbff 100644 --- a/test/name-test/test-autolaunch.c +++ b/test/name-test/test-autolaunch.c @@ -19,6 +19,8 @@ main (int argc, char *argv[]) dbus_error_init (&error); conn = dbus_bus_get (DBUS_BUS_SESSION, &error); + +#ifdef DBUS_BUILD_X11 if (dbus_error_is_set (&error)) { fprintf (stderr, "*** Failed to autolaunch session bus: %s\n", @@ -26,6 +28,23 @@ main (int argc, char *argv[]) dbus_error_free (&error); return 1; } +#else + /* We don't necessarily expect it to *work* without X (although it might - + * for instance on Mac OS it might have used launchd). Just check that the + * results are consistent. */ + + if (dbus_error_is_set (&error) && conn != NULL) + { + fprintf (stderr, "*** Autolaunched session bus, but an error was set!\n"); + return 1; + } +#endif + + if (!dbus_error_is_set (&error) && conn == NULL) + { + fprintf (stderr, "*** Failed to autolaunch session bus but no error was set\n"); + return 1; + } return 0; } |