dbus_error_init (&f->e);
g_queue_init (&f->server_messages);
- if ((g_str_has_prefix (addr, "tcp:") ||
- g_str_has_prefix (addr, "nonce-tcp:")) &&
- !test_check_tcp_works ())
+ if ((g_str_has_prefix (addr, "unix:") && !test_check_af_unix_works ()) ||
+ ((g_str_has_prefix (addr, "tcp:") ||
+ g_str_has_prefix (addr, "nonce-tcp:")) &&
+ !test_check_tcp_works ()))
{
f->skip = TRUE;
return;
test_server_setup (f->ctx, f->server);
}
-#ifdef DBUS_UNIX
static void
setup_runtime (Fixture *f,
gconstpointer addr)
dbus_free (listening_at);
}
-#endif
static void
test_connect (Fixture *f,
g_assert_cmpstr (dbus_address_entry_get_value (entries[0], "noncefile"),
!=, NULL);
}
-#ifdef DBUS_UNIX
else if (g_str_has_prefix (listening_address, "unix:tmpdir="))
{
g_assert_cmpstr (dbus_address_entry_get_method (entries[0]), ==, "unix");
/* No particular statement about the path here: for that see
* setup_runtime() and setup_no_runtime() */
}
-#endif
else
{
g_assert_not_reached ();
test_main_context_unref (f->ctx);
}
-#ifdef DBUS_UNIX
static void
teardown_no_runtime (Fixture *f,
gconstpointer addr)
g_free (f->saved_runtime_dir);
g_free (f->tmp_runtime_dir);
}
-#endif
int
main (int argc,
g_test_add ("/message/bad-guid/tcp", Fixture, "tcp:host=127.0.0.1", setup,
test_bad_guid, teardown);
-#ifdef DBUS_UNIX
g_test_add ("/connect/unix/tmpdir", Fixture, unix_tmpdir, setup,
test_connect, teardown);
g_test_add ("/message/unix/tmpdir", Fixture, unix_tmpdir, setup,
g_test_add ("/message/bad-guid/unix", Fixture, unix_tmpdir, setup,
test_bad_guid, teardown);
-#endif
ret = g_test_run ();
dbus_shutdown ();