int fd_before;
} Fixture;
-#if !GLIB_CHECK_VERSION (2, 38, 0)
-#define g_test_skip(s) my_test_skip (s)
-static inline void my_test_skip (const gchar *s)
-{
- g_message ("SKIP: %s", s);
-}
-#endif
-
#ifdef HAVE_UNIX_FD_PASSING
static void oom (const gchar *doing) G_GNUC_NORETURN;
#ifdef DBUS_UNIX
if (getuid () != 0)
{
- g_message ("SKIP: cannot use alternative uid when not uid 0");
+ g_test_skip ("cannot use alternative uid when not uid 0");
return NULL;
}
if (pwd == NULL)
{
- g_message ("SKIP: user '%s' does not exist", DBUS_USER);
+ gchar *message = g_strdup_printf ("user '%s' does not exist",
+ DBUS_USER);
+
+ g_test_skip (message);
+ g_free (message);
return NULL;
}
if (pwd == NULL)
{
- g_message ("SKIP: user '%s' does not exist", DBUS_TEST_USER);
+ gchar *message = g_strdup_printf ("user '%s' does not exist",
+ DBUS_TEST_USER);
+
+ g_test_skip (message);
+ g_free (message);
return NULL;
}
g_assert_not_reached ();
}
#else
- g_message ("SKIP: cannot use alternative uid on Windows");
+ g_test_skip ("cannot use alternative uid on Windows");
return NULL;
#endif
}
if (g_getenv ("DBUS_TEST_DATA") == NULL)
{
- g_message ("SKIP: set DBUS_TEST_DATA to a directory containing %s",
+ g_test_message ("set DBUS_TEST_DATA to a directory containing %s",
config_file);
+ g_test_skip ("DBUS_TEST_DATA not set");
return NULL;
}
{
if (config_file != NULL || user != TEST_USER_ME)
{
- g_message ("SKIP: cannot use DBUS_TEST_DAEMON_ADDRESS for "
+ g_test_skip ("cannot use DBUS_TEST_DAEMON_ADDRESS for "
"unusally-configured dbus-daemon");
address = NULL;
}
if (ruid != 0 || euid != 0 || suid != 0)
{
- g_message ("SKIP: not uid 0 (ruid=%ld euid=%ld suid=%ld)",
+ g_test_message ("not uid 0 (ruid=%ld euid=%ld suid=%ld)",
(unsigned long) ruid, (unsigned long) euid, (unsigned long) suid);
+ g_test_skip ("not uid 0");
return NULL;
}
if (pwd == NULL)
{
- g_message ("SKIP: getpwnam(\"%s\"): %s", username, g_strerror (errno));
+ g_test_message ("getpwnam(\"%s\"): %s", username, g_strerror (errno));
+ g_test_skip ("not uid 0");
return NULL;
}
return test_connect_to_bus (ctx, address);
default:
- g_message ("SKIP: setresuid() not available, or unsure about "
+ g_test_skip ("setresuid() not available, or unsure about "
"credentials-passing semantics on this platform");
return NULL;
}