From 83bdfea8a93ef7eef582409a7eea63275458408f Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 24 Oct 2018 12:03:14 +0200 Subject: [PATCH] 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 --- test/name-test/test-shutdown.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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) -- 2.47.3