diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2017-02-17 17:08:20 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2017-02-20 18:09:05 +0000 |
commit | 81c82d2f34b616cdc80a5a332fcb11aab85dded4 (patch) | |
tree | 6032bbe83fe33f6b7b0ef4fc638c0db9bb60c5eb | |
parent | 867a600bf7f8716241e5aa1cf1024ce113182198 (diff) |
config-parser: Remove dead code from system service dirs test
progs was never used, because it was originally only used on
Windows, where this test makes no sense and so is no longer run.
It is unnecessary to check that the system service directories end
with dbus-1/system-services, because we are going to check their
exact values a short time later anyway.
It is also unnecessary to set XDG_DATA_HOME and XDG_DATA_DIRS,
because those variables are no longer respected for system service
directories, only for session service directories.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | bus/config-parser.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/bus/config-parser.c b/bus/config-parser.c index 08ec8950..e3c6f1a8 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -3533,46 +3533,10 @@ test_default_system_servicedirs (void) { DBusList *dirs; DBusList *link; - DBusString progs; int i; - /* On Unix we don't actually use this variable, but it's easier to handle the - * deallocation if we always allocate it, whether needed or not */ - if (!_dbus_string_init (&progs)) - _dbus_assert_not_reached ("OOM allocating progs"); - dirs = NULL; - printf ("Testing retrieving the default system service directories\n"); - if (!_dbus_get_standard_system_servicedirs (&dirs)) - _dbus_assert_not_reached ("couldn't get stardard dirs"); - - /* make sure our defaults end with share/dbus-1/system-service */ - while ((link = _dbus_list_pop_first_link (&dirs))) - { - DBusString path; - - printf (" default service dir: %s\n", (char *)link->data); - _dbus_string_init_const (&path, (char *)link->data); - if (!_dbus_string_ends_with_c_str (&path, "dbus-1/system-services")) - { - printf ("error with default system service directories\n"); - dbus_free (link->data); - _dbus_list_free_link (link); - _dbus_string_free (&progs); - return FALSE; - } - - dbus_free (link->data); - _dbus_list_free_link (link); - } - - if (!dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare")) - _dbus_assert_not_reached ("couldn't setenv XDG_DATA_HOME"); - - if (!dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:")) - _dbus_assert_not_reached ("couldn't setenv XDG_DATA_DIRS"); - if (!_dbus_get_standard_system_servicedirs (&dirs)) _dbus_assert_not_reached ("couldn't get stardard dirs"); @@ -3586,7 +3550,6 @@ test_default_system_servicedirs (void) printf ("more directories parsed than in match set\n"); dbus_free (link->data); _dbus_list_free_link (link); - _dbus_string_free (&progs); return FALSE; } @@ -3598,7 +3561,6 @@ test_default_system_servicedirs (void) test_system_service_dir_matches[i]); dbus_free (link->data); _dbus_list_free_link (link); - _dbus_string_free (&progs); return FALSE; } @@ -3613,11 +3575,9 @@ test_default_system_servicedirs (void) printf ("extra data %s in the match set was not matched\n", test_system_service_dir_matches[i]); - _dbus_string_free (&progs); return FALSE; } - _dbus_string_free (&progs); return TRUE; } #endif |