mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-09 04:58:02 +02:00
tests/corrupt: do not hardcode /tmp on !unix
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
58992c88bc
commit
a19d2e7f09
1 changed files with 11 additions and 2 deletions
|
|
@ -406,6 +406,12 @@ main (int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
#ifdef DBUS_UNIX
|
||||||
|
char *tmp = _dbus_strdup ("/tmp");
|
||||||
|
#else
|
||||||
|
char *tmp = dbus_address_escape_value (g_get_tmp_dir ());
|
||||||
|
#endif
|
||||||
|
gchar *unix_tmpdir = g_strdup_printf ("unix:tmpdir=%s", tmp);
|
||||||
|
|
||||||
test_init (&argc, &argv);
|
test_init (&argc, &argv);
|
||||||
|
|
||||||
|
|
@ -413,7 +419,7 @@ main (int argc,
|
||||||
test_corrupt, teardown);
|
test_corrupt, teardown);
|
||||||
|
|
||||||
#ifdef DBUS_UNIX
|
#ifdef DBUS_UNIX
|
||||||
g_test_add ("/corrupt/unix", Fixture, "unix:tmpdir=/tmp", setup,
|
g_test_add ("/corrupt/unix", Fixture, unix_tmpdir, setup,
|
||||||
test_corrupt, teardown);
|
test_corrupt, teardown);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -421,11 +427,14 @@ main (int argc,
|
||||||
test_byte_order, teardown);
|
test_byte_order, teardown);
|
||||||
|
|
||||||
#ifdef DBUS_UNIX
|
#ifdef DBUS_UNIX
|
||||||
g_test_add ("/corrupt/byte-order/unix", Fixture, "unix:tmpdir=/tmp", setup,
|
g_test_add ("/corrupt/byte-order/unix", Fixture, unix_tmpdir, setup,
|
||||||
test_byte_order, teardown);
|
test_byte_order, teardown);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = g_test_run ();
|
ret = g_test_run ();
|
||||||
dbus_shutdown ();
|
dbus_shutdown ();
|
||||||
|
|
||||||
|
g_free (unix_tmpdir);
|
||||||
|
dbus_free (tmp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue