From: Ralf Habacker Date: Wed, 24 Oct 2018 10:03:14 +0000 (+0200) Subject: Fix test-shutdown bail out on Windows X-Git-Tag: dbus-1.13.10~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83bdfea8a93ef7eef582409a7eea63275458408f;p=thirdparty%2Fdbus.git Fix test-shutdown bail out on Windows test-shutdown expects a GUID in the bus address by default, which is not available under Windows, because on this platform an autolaunch address is provided by dbus-run-session and is not returned by dbus-daemon. Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/59 Reviewed-by: Simon McVittie --- diff --git a/test/name-test/test-shutdown.c b/test/name-test/test-shutdown.c index b195bbb71..26b610084 100644 --- a/test/name-test/test-shutdown.c +++ b/test/name-test/test-shutdown.c @@ -21,15 +21,19 @@ open_destroy_shared_session_bus_connection (void) DBusConnection *connection; char *session_addr_no_guid; char *comma; - + dbus_error_init (&error); session_addr_no_guid = strdup (getenv ("DBUS_SESSION_BUS_ADDRESS")); comma = strchr (session_addr_no_guid, ','); - if (comma == NULL) - die ("Couldn't find GUID in session bus address"); + +#ifdef DBUS_WIN + _dbus_assert (comma == NULL); +#else + _dbus_assert (comma != NULL); *comma = '\0'; - +#endif + connection = dbus_connection_open (session_addr_no_guid, &error); free (session_addr_no_guid); if (connection == NULL)