diff options
Diffstat (limited to 'src/test')
103 files changed, 552 insertions, 510 deletions
diff --git a/src/test/Makefile b/src/test/Makefile index d0b0e8e008..f416b4aadf 120000..100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -1 +1,35 @@ -../Makefile
\ No newline at end of file +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see <http://www.gnu.org/licenses/>. +include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +test_id128_SOURCES = \ + src/test/test-id128.c + +test_id128_LDADD = \ + libshared.la + +tests += \ + test-id128 + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/test/test-acl-util.c b/src/test/test-acl-util.c index 430dda8e78..1417d596e4 100644 --- a/src/test/test-acl-util.c +++ b/src/test/test-acl-util.c @@ -22,11 +22,11 @@ #include <sys/stat.h> #include <unistd.h> -#include "acl-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "string-util.h" -#include "user-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/string-util.h" +#include "basic/user-util.h" +#include "shared/acl-util.h" static void test_add_acls_for_user(void) { char fn[] = "/tmp/test-empty.XXXXXX"; diff --git a/src/test/test-af-list.c b/src/test/test-af-list.c index aeaa0929b1..21115e677a 100644 --- a/src/test/test-af-list.c +++ b/src/test/test-af-list.c @@ -20,15 +20,15 @@ #include <string.h> #include <sys/socket.h> -#include "macro.h" -#include "string-util.h" -#include "util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/util.h" static const struct af_name* lookup_af(register const char *str, register unsigned int len); -#include "af-from-name.h" -#include "af-list.h" -#include "af-to-name.h" +#include "basic/af-from-name.h" +#include "basic/af-list.h" +#include "basic/af-to-name.h" int main(int argc, const char *argv[]) { diff --git a/src/test/test-alloc-util.c b/src/test/test-alloc-util.c index cc4821eaf5..520951495d 100644 --- a/src/test/test-alloc-util.c +++ b/src/test/test-alloc-util.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "macro.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/macro.h" +#include "basic/util.h" static void test_alloca(void) { static const uint8_t zero[997] = { }; diff --git a/src/test/test-architecture.c b/src/test/test-architecture.c index f41e488d99..6373b798b0 100644 --- a/src/test/test-architecture.c +++ b/src/test/test-architecture.c @@ -17,10 +17,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "architecture.h" -#include "log.h" -#include "util.h" -#include "virt.h" +#include "basic/architecture.h" +#include "basic/log.h" +#include "basic/util.h" +#include "basic/virt.h" int main(int argc, char *argv[]) { int a, v; diff --git a/src/test/test-arphrd-list.c b/src/test/test-arphrd-list.c index f3989ad201..976958e733 100644 --- a/src/test/test-arphrd-list.c +++ b/src/test/test-arphrd-list.c @@ -20,15 +20,15 @@ #include <net/if_arp.h> #include <string.h> -#include "macro.h" -#include "string-util.h" -#include "util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/util.h" static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len); -#include "arphrd-from-name.h" -#include "arphrd-list.h" -#include "arphrd-to-name.h" +#include "basic/arphrd-from-name.h" +#include "basic/arphrd-list.h" +#include "basic/arphrd-to-name.h" int main(int argc, const char *argv[]) { diff --git a/src/test/test-ask-password-api.c b/src/test/test-ask-password-api.c index 86666597c7..a93e821c7d 100644 --- a/src/test/test-ask-password-api.c +++ b/src/test/test-ask-password-api.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "ask-password-api.h" -#include "log.h" +#include "basic/alloc-util.h" +#include "basic/log.h" +#include "shared/ask-password-api.h" static void ask_password(void) { int r; diff --git a/src/test/test-async.c b/src/test/test-async.c index ada6d67c42..627768b392 100644 --- a/src/test/test-async.c +++ b/src/test/test-async.c @@ -19,10 +19,10 @@ #include <unistd.h> -#include "async.h" -#include "fileio.h" -#include "macro.h" -#include "util.h" +#include "basic/async.h" +#include "basic/fileio.h" +#include "basic/macro.h" +#include "basic/util.h" static bool test_async = false; diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c index e6aa3b5cfe..1123f33f16 100644 --- a/src/test/test-barrier.c +++ b/src/test/test-barrier.c @@ -31,8 +31,8 @@ #include <sys/wait.h> #include <unistd.h> -#include "barrier.h" -#include "util.h" +#include "basic/barrier.h" +#include "basic/util.h" /* 20ms to test deadlocks; All timings use multiples of this constant as * alarm/sleep timers. If this timeout is too small for slow machines to perform diff --git a/src/test/test-bitmap.c b/src/test/test-bitmap.c index ff22117745..b18bcef9ae 100644 --- a/src/test/test-bitmap.c +++ b/src/test/test-bitmap.c @@ -17,7 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "bitmap.h" +#include "basic/bitmap.h" int main(int argc, const char *argv[]) { _cleanup_bitmap_free_ Bitmap *b = NULL, *b2 = NULL; diff --git a/src/test/test-boot-timestamps.c b/src/test/test-boot-timestamps.c index 8e68d6510d..022d101957 100644 --- a/src/test/test-boot-timestamps.c +++ b/src/test/test-boot-timestamps.c @@ -18,11 +18,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "acpi-fpdt.h" -#include "boot-timestamps.h" -#include "efivars.h" -#include "log.h" -#include "util.h" +#include "basic/log.h" +#include "basic/util.h" +#include "shared/acpi-fpdt.h" +#include "shared/boot-timestamps.h" +#include "shared/efivars.h" static int test_acpi_fpdt(void) { usec_t loader_start; diff --git a/src/test/test-btrfs.c b/src/test/test-btrfs.c index ce29d88412..eb33a3937f 100644 --- a/src/test/test-btrfs.c +++ b/src/test/test-btrfs.c @@ -19,13 +19,13 @@ #include <fcntl.h> -#include "btrfs-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "log.h" -#include "parse-util.h" -#include "string-util.h" -#include "util.h" +#include "basic/btrfs-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/log.h" +#include "basic/parse-util.h" +#include "basic/string-util.h" +#include "basic/util.h" int main(int argc, char *argv[]) { BtrfsQuotaInfo quota; diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c index 5a8c6cbfb6..afa9b4e362 100644 --- a/src/test/test-calendarspec.c +++ b/src/test/test-calendarspec.c @@ -19,10 +19,10 @@ #include <string.h> -#include "alloc-util.h" -#include "calendarspec.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/calendarspec.h" +#include "basic/string-util.h" +#include "basic/util.h" static void test_one(const char *input, const char *output) { CalendarSpec *c; diff --git a/src/test/test-cap-list.c b/src/test/test-cap-list.c index 4132ec56fd..6af0a45b66 100644 --- a/src/test/test-cap-list.c +++ b/src/test/test-cap-list.c @@ -19,12 +19,12 @@ #include <sys/prctl.h> -#include "alloc-util.h" -#include "cap-list.h" -#include "capability-util.h" -#include "fileio.h" -#include "parse-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/cap-list.h" +#include "basic/capability-util.h" +#include "basic/fileio.h" +#include "basic/parse-util.h" +#include "basic/util.h" /* verify the capability parser */ static void test_cap_list(void) { diff --git a/src/test/test-capability.c b/src/test/test-capability.c index 629bb63c81..07e52c2ba8 100644 --- a/src/test/test-capability.c +++ b/src/test/test-capability.c @@ -25,10 +25,10 @@ #include <sys/wait.h> #include <unistd.h> -#include "capability-util.h" -#include "fd-util.h" -#include "macro.h" -#include "util.h" +#include "basic/capability-util.h" +#include "basic/fd-util.h" +#include "basic/macro.h" +#include "basic/util.h" static uid_t test_uid = -1; static gid_t test_gid = -1; diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c index a027eb0fd2..6d889c98d2 100644 --- a/src/test/test-cgroup-mask.c +++ b/src/test/test-cgroup-mask.c @@ -19,13 +19,14 @@ #include <stdio.h> -#include "macro.h" +#include "basic/macro.h" +#include "basic/rm-rf.h" #include "manager.h" -#include "rm-rf.h" -#include "test-helper.h" -#include "tests.h" +#include "shared/tests.h" #include "unit.h" +#include "test-helper.h" + static int test_cgroup_mask(void) { Manager *m = NULL; Unit *son, *daughter, *parent, *root, *grandchild, *parent_deep; diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index 43f8906172..394839bc83 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -17,17 +17,18 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "cgroup-util.h" -#include "dirent-util.h" -#include "fd-util.h" -#include "formats-util.h" -#include "parse-util.h" -#include "process-util.h" -#include "string-util.h" +#include "basic/alloc-util.h" +#include "basic/cgroup-util.h" +#include "basic/dirent-util.h" +#include "basic/fd-util.h" +#include "basic/formats-util.h" +#include "basic/parse-util.h" +#include "basic/process-util.h" +#include "basic/string-util.h" +#include "basic/user-util.h" +#include "basic/util.h" + #include "test-helper.h" -#include "user-util.h" -#include "util.h" static void check_p_d_u(const char *path, int code, const char *result) { _cleanup_free_ char *unit = NULL; diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c index 72c32d9c8f..970b9a5f13 100644 --- a/src/test/test-cgroup.c +++ b/src/test/test-cgroup.c @@ -20,10 +20,10 @@ #include <string.h> #include <unistd.h> -#include "cgroup-util.h" -#include "path-util.h" -#include "string-util.h" -#include "util.h" +#include "basic/cgroup-util.h" +#include "basic/path-util.h" +#include "basic/string-util.h" +#include "basic/util.h" int main(int argc, char*argv[]) { char *path; diff --git a/src/test/test-clock.c b/src/test/test-clock.c index 84f775e5bc..c6a8e7aa1c 100644 --- a/src/test/test-clock.c +++ b/src/test/test-clock.c @@ -17,14 +17,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <unistd.h> #include <fcntl.h> +#include <unistd.h> -#include "clock-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "log.h" -#include "macro.h" +#include "basic/clock-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/log.h" +#include "basic/macro.h" static void test_clock_is_localtime(void) { char adjtime[] = "/tmp/test-adjtime.XXXXXX"; diff --git a/src/test/test-condition.c b/src/test/test-condition.c index 8903d10db7..00a86dedda 100644 --- a/src/test/test-condition.c +++ b/src/test/test-condition.c @@ -17,20 +17,20 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "sd-id128.h" - -#include "alloc-util.h" -#include "apparmor-util.h" -#include "architecture.h" -#include "audit-util.h" -#include "condition.h" -#include "hostname-util.h" -#include "ima-util.h" -#include "log.h" -#include "macro.h" -#include "selinux-util.h" -#include "smack-util.h" -#include "util.h" +#include <systemd/sd-id128.h> + +#include "basic/alloc-util.h" +#include "basic/architecture.h" +#include "basic/audit-util.h" +#include "basic/hostname-util.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/selinux-util.h" +#include "basic/smack-util.h" +#include "basic/util.h" +#include "shared/apparmor-util.h" +#include "shared/condition.h" +#include "shared/ima-util.h" static void test_condition_test_path(void) { Condition *condition; diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c index 03b3a9fa5c..336e980e07 100644 --- a/src/test/test-conf-files.c +++ b/src/test/test-conf-files.c @@ -20,16 +20,16 @@ #include <stdarg.h> #include <stdio.h> -#include "alloc-util.h" -#include "conf-files.h" -#include "fs-util.h" -#include "macro.h" -#include "parse-util.h" -#include "rm-rf.h" -#include "string-util.h" -#include "strv.h" -#include "user-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/conf-files.h" +#include "basic/fs-util.h" +#include "basic/macro.h" +#include "basic/parse-util.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/user-util.h" +#include "basic/util.h" static void setup_test_dir(char *tmp_dir, const char *files, ...) { va_list ap; diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c index be5d2611f8..1536e7937d 100644 --- a/src/test/test-conf-parser.c +++ b/src/test/test-conf-parser.c @@ -17,12 +17,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "conf-parser.h" -#include "log.h" -#include "macro.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" +#include "shared/conf-parser.h" static void test_config_parse_path_one(const char *rvalue, const char *expected) { char *path = NULL; diff --git a/src/test/test-copy.c b/src/test/test-copy.c index 68154fc4e8..cd9def191c 100644 --- a/src/test/test-copy.c +++ b/src/test/test-copy.c @@ -19,19 +19,19 @@ #include <unistd.h> -#include "alloc-util.h" -#include "copy.h" -#include "fd-util.h" -#include "fileio.h" -#include "fs-util.h" -#include "log.h" -#include "macro.h" -#include "mkdir.h" -#include "path-util.h" -#include "rm-rf.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/copy.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/fs-util.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/mkdir.h" +#include "basic/path-util.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" static void test_copy_file(void) { _cleanup_free_ char *buf = NULL; diff --git a/src/test/test-cpu-set-util.c b/src/test/test-cpu-set-util.c index 8818d1ffb7..0558f323ea 100644 --- a/src/test/test-cpu-set-util.c +++ b/src/test/test-cpu-set-util.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "cpu-set-util.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/cpu-set-util.h" +#include "basic/macro.h" static void test_parse_cpu_set(void) { cpu_set_t *c = NULL; diff --git a/src/test/test-daemon.c b/src/test/test-daemon.c index a7cb426282..98988e1e31 100644 --- a/src/test/test-daemon.c +++ b/src/test/test-daemon.c @@ -19,9 +19,9 @@ #include <unistd.h> -#include "sd-daemon.h" +#include <systemd/sd-daemon.h> -#include "strv.h" +#include "basic/strv.h" int main(int argc, char*argv[]) { _cleanup_strv_free_ char **l = NULL; diff --git a/src/test/test-date.c b/src/test/test-date.c index 7f497bb7d5..a7a2e9087c 100644 --- a/src/test/test-date.c +++ b/src/test/test-date.c @@ -19,9 +19,9 @@ #include <string.h> -#include "alloc-util.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/string-util.h" +#include "basic/util.h" static void test_should_pass(const char *p) { usec_t t, q; diff --git a/src/test/test-device-nodes.c b/src/test/test-device-nodes.c index af75b38948..2310fbb9c3 100644 --- a/src/test/test-device-nodes.c +++ b/src/test/test-device-nodes.c @@ -19,10 +19,10 @@ #include <sys/types.h> -#include "alloc-util.h" -#include "device-nodes.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/device-nodes.h" +#include "basic/string-util.h" +#include "basic/util.h" /* helpers for test_encode_devnode_name */ static char *do_encode_string(const char *in) { diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c index a9d09f59bc..930bd5dd62 100644 --- a/src/test/test-dns-domain.c +++ b/src/test/test-dns-domain.c @@ -17,10 +17,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "dns-domain.h" -#include "macro.h" -#include "string-util.h" +#include "basic/alloc-util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "shared/dns-domain.h" static void test_dns_label_unescape_one(const char *what, const char *expect, size_t buffer_sz, int ret) { char buffer[buffer_sz]; diff --git a/src/test/test-ellipsize.c b/src/test/test-ellipsize.c index d4f09b08a5..45e95fe597 100644 --- a/src/test/test-ellipsize.c +++ b/src/test/test-ellipsize.c @@ -19,11 +19,11 @@ #include <stdio.h> -#include "alloc-util.h" -#include "def.h" -#include "string-util.h" -#include "terminal-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/def.h" +#include "basic/string-util.h" +#include "basic/terminal-util.h" +#include "basic/util.h" static void test_one(const char *p) { _cleanup_free_ char *t; diff --git a/src/test/test-engine.c b/src/test/test-engine.c index 23da10fa1a..9d21bb5723 100644 --- a/src/test/test-engine.c +++ b/src/test/test-engine.c @@ -21,11 +21,12 @@ #include <stdio.h> #include <string.h> -#include "bus-util.h" +#include "basic/rm-rf.h" #include "manager.h" -#include "rm-rf.h" +#include "shared/bus-util.h" +#include "shared/tests.h" + #include "test-helper.h" -#include "tests.h" int main(int argc, char *argv[]) { _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL; diff --git a/src/test/test-env-util.c b/src/test/test-env-util.c index 35bb62906e..30d99fcd51 100644 --- a/src/test/test-env-util.c +++ b/src/test/test-env-util.c @@ -20,10 +20,10 @@ #include <string.h> -#include "env-util.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/env-util.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" static void test_strv_env_delete(void) { _cleanup_strv_free_ char **a = NULL, **b = NULL, **c = NULL, **d = NULL; diff --git a/src/test/test-escape.c b/src/test/test-escape.c index 6cbb8443fe..874647541c 100644 --- a/src/test/test-escape.c +++ b/src/test/test-escape.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "escape.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/escape.h" +#include "basic/macro.h" static void test_cescape(void) { _cleanup_free_ char *escaped; diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 77ef4e8b2a..7cd63168c8 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -23,16 +23,17 @@ #include <sys/prctl.h> #include <sys/types.h> -#include "fileio.h" -#include "fs-util.h" -#include "macro.h" +#include "basic/fileio.h" +#include "basic/fs-util.h" +#include "basic/macro.h" +#include "basic/mkdir.h" +#include "basic/path-util.h" +#include "basic/rm-rf.h" +#include "basic/util.h" #include "manager.h" -#include "mkdir.h" -#include "path-util.h" -#include "rm-rf.h" -#include "test-helper.h" #include "unit.h" -#include "util.h" + +#include "test-helper.h" typedef void (*test_function_t)(Manager *m); diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c index 7a23fa7b7b..3d6548b7c7 100644 --- a/src/test/test-extract-word.c +++ b/src/test/test-extract-word.c @@ -21,9 +21,9 @@ #include <stdlib.h> #include <string.h> -#include "extract-word.h" -#include "log.h" -#include "string-util.h" +#include "basic/extract-word.h" +#include "basic/log.h" +#include "basic/string-util.h" static void test_extract_first_word(void) { const char *p, *original; diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c index 421d3bdeb3..f6c1f302c1 100644 --- a/src/test/test-fd-util.c +++ b/src/test/test-fd-util.c @@ -20,10 +20,10 @@ #include <fcntl.h> #include <unistd.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/macro.h" static void test_close_many(void) { int fds[3]; diff --git a/src/test/test-fdset.c b/src/test/test-fdset.c index 282aab1246..9ad122f628 100644 --- a/src/test/test-fdset.c +++ b/src/test/test-fdset.c @@ -20,11 +20,11 @@ #include <fcntl.h> #include <unistd.h> -#include "fd-util.h" -#include "fdset.h" -#include "fileio.h" -#include "macro.h" -#include "util.h" +#include "basic/fd-util.h" +#include "basic/fdset.h" +#include "basic/fileio.h" +#include "basic/macro.h" +#include "basic/util.h" static void test_fdset_new_fill(void) { int fd = -1; diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index 79609765e0..f5a99d668d 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -17,22 +17,22 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <ctype.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> -#include "alloc-util.h" -#include "ctype.h" -#include "def.h" -#include "env-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "io-util.h" -#include "parse-util.h" -#include "process-util.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/def.h" +#include "basic/env-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/io-util.h" +#include "basic/parse-util.h" +#include "basic/process-util.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" static void test_parse_env_file(void) { char t[] = "/tmp/test-fileio-in-XXXXXX", diff --git a/src/test/test-firewall-util.c b/src/test/test-firewall-util.c index 77e809c5bf..28ab25dd78 100644 --- a/src/test/test-firewall-util.c +++ b/src/test/test-firewall-util.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "basic/log.h" #include "firewall-util.h" -#include "log.h" #define MAKE_IN_ADDR_UNION(a,b,c,d) (union in_addr_union) { .in.s_addr = htobe32((uint32_t) (a) << 24 | (uint32_t) (b) << 16 | (uint32_t) (c) << 8 | (uint32_t) (d))} diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c index 6db2c2b6f1..7002eb841a 100644 --- a/src/test/test-fs-util.c +++ b/src/test/test-fs-util.c @@ -19,16 +19,16 @@ #include <unistd.h> -#include "alloc-util.h" -#include "fileio.h" -#include "fd-util.h" -#include "fs-util.h" -#include "macro.h" -#include "mkdir.h" -#include "rm-rf.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/fs-util.h" +#include "basic/macro.h" +#include "basic/mkdir.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" static void test_unlink_noerrno(void) { char name[] = "/tmp/test-close_nointr.XXXXXX"; diff --git a/src/test/test-fstab-util.c b/src/test/test-fstab-util.c index 63a4b8c243..181ff230e0 100644 --- a/src/test/test-fstab-util.c +++ b/src/test/test-fstab-util.c @@ -17,11 +17,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "fstab-util.h" -#include "log.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/log.h" +#include "basic/string-util.h" +#include "basic/util.h" +#include "shared/fstab-util.h" /* int fstab_filter_options(const char *opts, const char *names, diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c index 227d4290f0..fd6dde113a 100644 --- a/src/test/test-glob-util.c +++ b/src/test/test-glob-util.c @@ -20,10 +20,10 @@ #include <fcntl.h> #include <unistd.h> -#include "alloc-util.h" -#include "fileio.h" -#include "glob-util.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/fileio.h" +#include "basic/glob-util.h" +#include "basic/macro.h" static void test_glob_exists(void) { char name[] = "/tmp/test-glob_exists.XXXXXX"; diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 1bd5c02f87..bbb24d885e 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -17,11 +17,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "hashmap.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/hashmap.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" void test_hashmap_funcs(void); diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c index 83cea360e6..c927d99079 100644 --- a/src/test/test-hashmap.c +++ b/src/test/test-hashmap.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "hashmap.h" -#include "util.h" +#include "basic/hashmap.h" +#include "basic/util.h" void test_hashmap_funcs(void); void test_ordered_hashmap_funcs(void); diff --git a/src/test/test-helper.h b/src/test/test-helper.h index ddb10f88fd..0b1acde587 100644 --- a/src/test/test-helper.h +++ b/src/test/test-helper.h @@ -19,9 +19,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "sd-daemon.h" +#include <systemd/sd-daemon.h> -#include "macro.h" +#include "basic/macro.h" #define TEST_REQ_RUNNING_SYSTEMD(x) \ if (sd_booted() > 0) { \ diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c index 276f25d091..f56035d84a 100644 --- a/src/test/test-hexdecoct.c +++ b/src/test/test-hexdecoct.c @@ -17,10 +17,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "hexdecoct.h" -#include "macro.h" -#include "string-util.h" +#include "basic/alloc-util.h" +#include "basic/hexdecoct.h" +#include "basic/macro.h" +#include "basic/string-util.h" static void test_hexchar(void) { assert_se(hexchar(0xa) == 'a'); diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c index 17fde9f27e..a8e598c58e 100644 --- a/src/test/test-hostname-util.c +++ b/src/test/test-hostname-util.c @@ -19,11 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "fileio.h" -#include "hostname-util.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/fileio.h" +#include "basic/hostname-util.h" +#include "basic/string-util.h" +#include "basic/util.h" static void test_hostname_is_valid(void) { assert_se(hostname_is_valid("foobar", false)); diff --git a/src/test/test-hostname.c b/src/test/test-hostname.c index b38507df5d..7408d51725 100644 --- a/src/test/test-hostname.c +++ b/src/test/test-hostname.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "basic/util.h" #include "hostname-setup.h" -#include "util.h" int main(int argc, char* argv[]) { int r; diff --git a/src/test/test-id128.c b/src/test/test-id128.c index 96aa008c06..aa41068530 100644 --- a/src/test/test-id128.c +++ b/src/test/test-id128.c @@ -19,13 +19,13 @@ #include <string.h> -#include "sd-daemon.h" -#include "sd-id128.h" +#include <systemd/sd-daemon.h> +#include <systemd/sd-id128.h> -#include "alloc-util.h" -#include "macro.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/util.h" #define ID128_WALDI SD_ID128_MAKE(01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 10) #define STR_WALDI "0102030405060708090a0b0c0d0e0f10" diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c index 4b9a74fca4..c0d696dcdc 100644 --- a/src/test/test-install-root.c +++ b/src/test/test-install-root.c @@ -17,12 +17,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "fileio.h" -#include "install.h" -#include "mkdir.h" -#include "rm-rf.h" -#include "string-util.h" +#include "basic/alloc-util.h" +#include "basic/fileio.h" +#include "basic/mkdir.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "shared/install.h" static void test_basic_mask_and_enable(const char *root) { const char *p; diff --git a/src/test/test-install.c b/src/test/test-install.c index 0ac85f040a..784bcfdd5f 100644 --- a/src/test/test-install.c +++ b/src/test/test-install.c @@ -20,7 +20,7 @@ #include <stdio.h> #include <string.h> -#include "install.h" +#include "shared/install.h" static void dump_changes(UnitFileChange *c, unsigned n) { unsigned i; diff --git a/src/test/test-io-util.c b/src/test/test-io-util.c index 10bd3833bc..496b58eb95 100644 --- a/src/test/test-io-util.c +++ b/src/test/test-io-util.c @@ -21,10 +21,10 @@ #include <stdlib.h> #include <unistd.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "io-util.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/io-util.h" +#include "basic/macro.h" static void test_sparse_write_one(int fd, const char *buffer, size_t n) { char check[n]; diff --git a/src/test/test-ipcrm.c b/src/test/test-ipcrm.c index c5bcaf47bb..a37aa4a10d 100644 --- a/src/test/test-ipcrm.c +++ b/src/test/test-ipcrm.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "clean-ipc.h" -#include "user-util.h" -#include "util.h" +#include "basic/user-util.h" +#include "basic/util.h" +#include "shared/clean-ipc.h" int main(int argc, char *argv[]) { uid_t uid; diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c index e28de9b37b..83c8b81690 100644 --- a/src/test/test-libudev.c +++ b/src/test/test-libudev.c @@ -22,14 +22,14 @@ #include <sys/epoll.h> #include <unistd.h> -#include "libudev.h" - -#include "fd-util.h" -#include "log.h" -#include "stdio-util.h" -#include "string-util.h" -#include "udev-util.h" -#include "util.h" +#include <libudev.h> + +#include "basic/fd-util.h" +#include "basic/log.h" +#include "basic/stdio-util.h" +#include "basic/string-util.h" +#include "basic/util.h" +#include "shared/udev-util.h" static void print_device(struct udev_device *device) { const char *str; diff --git a/src/test/test-list.c b/src/test/test-list.c index 160064d06a..ec32684d78 100644 --- a/src/test/test-list.c +++ b/src/test/test-list.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "list.h" -#include "util.h" +#include "basic/list.h" +#include "basic/util.h" int main(int argc, const char *argv[]) { size_t i; diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index 427c698d1d..702134ca46 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -18,9 +18,9 @@ ***/ -#include "locale-util.h" -#include "macro.h" -#include "strv.h" +#include "basic/locale-util.h" +#include "basic/macro.h" +#include "basic/strv.h" static void test_get_locales(void) { _cleanup_strv_free_ char **locales = NULL; diff --git a/src/test/test-log.c b/src/test/test-log.c index 55a2f9d23b..7a5f78a3d6 100644 --- a/src/test/test-log.c +++ b/src/test/test-log.c @@ -20,9 +20,9 @@ #include <stddef.h> #include <unistd.h> -#include "formats-util.h" -#include "log.h" -#include "util.h" +#include "basic/formats-util.h" +#include "basic/log.h" +#include "basic/util.h" int main(int argc, char* argv[]) { diff --git a/src/test/test-loopback.c b/src/test/test-loopback.c index 7b67337331..479f74862f 100644 --- a/src/test/test-loopback.c +++ b/src/test/test-loopback.c @@ -20,7 +20,7 @@ #include <stdio.h> #include <string.h> -#include "log.h" +#include "basic/log.h" #include "loopback-setup.h" int main(int argc, char* argv[]) { diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c index ff9f35cecd..d877c61756 100644 --- a/src/test/test-namespace.c +++ b/src/test/test-namespace.c @@ -19,12 +19,12 @@ #include <sys/socket.h> -#include "alloc-util.h" -#include "fd-util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/process-util.h" +#include "basic/string-util.h" +#include "basic/util.h" #include "namespace.h" -#include "process-util.h" -#include "string-util.h" -#include "util.h" static void test_tmpdir(const char *id, const char *A, const char *B) { _cleanup_free_ char *a, *b; diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c index bc6dd0926c..49b659b3a9 100644 --- a/src/test/test-netlink-manual.c +++ b/src/test/test-netlink-manual.c @@ -19,14 +19,14 @@ #include <arpa/inet.h> #include <libkmod.h> -#include <linux/ip.h> #include <net/if.h> -#include <linux/if_tunnel.h> -#include "sd-netlink.h" +#include <linux/ip.h> +#include <linux/if_tunnel.h> -#include "macro.h" -#include "util.h" +#include "basic/macro.h" +#include "basic/util.h" +#include "sd-netlink/sd-netlink.h" static int load_module(const char *mod_name) { struct kmod_ctx *ctx; diff --git a/src/test/test-ns.c b/src/test/test-ns.c index 9248f2987c..43cbbb69b0 100644 --- a/src/test/test-ns.c +++ b/src/test/test-ns.c @@ -20,7 +20,7 @@ #include <stdlib.h> #include <unistd.h> -#include "log.h" +#include "basic/log.h" #include "namespace.h" int main(int argc, char *argv[]) { diff --git a/src/test/test-nss.c b/src/test/test-nss.c index 55af592287..876e978d22 100644 --- a/src/test/test-nss.c +++ b/src/test/test-nss.c @@ -18,22 +18,22 @@ ***/ #include <dlfcn.h> -#include <stdlib.h> #include <net/if.h> +#include <stdlib.h> -#include "log.h" -#include "nss-util.h" -#include "path-util.h" -#include "string-util.h" -#include "alloc-util.h" -#include "in-addr-util.h" -#include "hexdecoct.h" -#include "af-list.h" -#include "stdio-util.h" -#include "strv.h" -#include "errno-list.h" -#include "hostname-util.h" -#include "local-addresses.h" +#include "basic/af-list.h" +#include "basic/alloc-util.h" +#include "basic/errno-list.h" +#include "basic/hexdecoct.h" +#include "basic/hostname-util.h" +#include "basic/in-addr-util.h" +#include "basic/log.h" +#include "basic/nss-util.h" +#include "basic/path-util.h" +#include "basic/stdio-util.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "sd-netlink/local-addresses.h" static const char* nss_status_to_string(enum nss_status status, char *buf, size_t buf_len) { switch (status) { diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c index 7d8677e17c..423bf8a78c 100644 --- a/src/test/test-parse-util.c +++ b/src/test/test-parse-util.c @@ -21,8 +21,8 @@ #include <locale.h> #include <math.h> -#include "log.h" -#include "parse-util.h" +#include "basic/log.h" +#include "basic/parse-util.h" static void test_parse_boolean(void) { assert_se(parse_boolean("1") == 1); diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c index 096326d176..6c6315bf2d 100644 --- a/src/test/test-path-lookup.c +++ b/src/test/test-path-lookup.c @@ -20,11 +20,11 @@ #include <stdlib.h> #include <sys/stat.h> -#include "log.h" -#include "path-lookup.h" -#include "rm-rf.h" -#include "string-util.h" -#include "strv.h" +#include "basic/log.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "shared/path-lookup.h" static void test_paths(UnitFileScope scope) { char template[] = "/tmp/test-path-lookup.XXXXXXX"; diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index b53324b5e6..8dbac28d7b 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -21,15 +21,15 @@ #include <sys/mount.h> #include <unistd.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "macro.h" -#include "mount-util.h" -#include "path-util.h" -#include "rm-rf.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/macro.h" +#include "basic/mount-util.h" +#include "basic/path-util.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" #define test_path_compare(a, b, result) { \ assert_se(path_compare(a, b) == result); \ diff --git a/src/test/test-path.c b/src/test/test-path.c index 62181e22a0..1cd09c89d8 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -20,19 +20,20 @@ #include <stdbool.h> #include <stdio.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "fs-util.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/fs-util.h" +#include "basic/macro.h" +#include "basic/mkdir.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" #include "manager.h" -#include "mkdir.h" -#include "rm-rf.h" -#include "string-util.h" -#include "strv.h" -#include "test-helper.h" -#include "tests.h" +#include "shared/tests.h" #include "unit.h" -#include "util.h" + +#include "test-helper.h" typedef void (*test_function_t)(Manager *m); diff --git a/src/test/test-prioq.c b/src/test/test-prioq.c index d81880a655..c0917d2187 100644 --- a/src/test/test-prioq.c +++ b/src/test/test-prioq.c @@ -19,11 +19,11 @@ #include <stdlib.h> -#include "alloc-util.h" -#include "prioq.h" -#include "set.h" -#include "siphash24.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/prioq.h" +#include "basic/set.h" +#include "basic/siphash24.h" +#include "basic/util.h" #define SET_SIZE 1024*4 diff --git a/src/test/test-proc-cmdline.c b/src/test/test-proc-cmdline.c index a7a8f621a2..e85c6bbf7d 100644 --- a/src/test/test-proc-cmdline.c +++ b/src/test/test-proc-cmdline.c @@ -17,12 +17,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "log.h" -#include "macro.h" -#include "proc-cmdline.h" -#include "special.h" -#include "string-util.h" +#include "basic/alloc-util.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/proc-cmdline.h" +#include "basic/special.h" +#include "basic/string-util.h" static int parse_item(const char *key, const char *value) { assert_se(key); diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c index 4616314200..6a0a5b46c2 100644 --- a/src/test/test-process-util.c +++ b/src/test/test-process-util.c @@ -24,15 +24,15 @@ #include <sys/wait.h> #include <unistd.h> -#include "alloc-util.h" -#include "architecture.h" -#include "log.h" -#include "macro.h" -#include "process-util.h" -#include "string-util.h" -#include "terminal-util.h" -#include "util.h" -#include "virt.h" +#include "basic/alloc-util.h" +#include "basic/architecture.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/process-util.h" +#include "basic/string-util.h" +#include "basic/terminal-util.h" +#include "basic/util.h" +#include "basic/virt.h" static void test_get_process_comm(void) { struct stat st; diff --git a/src/test/test-ratelimit.c b/src/test/test-ratelimit.c index 990b834c79..76bd254694 100644 --- a/src/test/test-ratelimit.c +++ b/src/test/test-ratelimit.c @@ -19,9 +19,9 @@ #include <unistd.h> -#include "macro.h" -#include "ratelimit.h" -#include "time-util.h" +#include "basic/macro.h" +#include "basic/ratelimit.h" +#include "basic/time-util.h" static void test_ratelimit_test(void) { int i; diff --git a/src/test/test-replace-var.c b/src/test/test-replace-var.c index 297effce79..5dce1d81d7 100644 --- a/src/test/test-replace-var.c +++ b/src/test/test-replace-var.c @@ -19,10 +19,10 @@ #include <string.h> -#include "macro.h" -#include "replace-var.h" -#include "string-util.h" -#include "util.h" +#include "basic/macro.h" +#include "basic/replace-var.h" +#include "basic/string-util.h" +#include "basic/util.h" static char *lookup(const char *variable, void *userdata) { return strjoin("<<<", variable, ">>>", NULL); diff --git a/src/test/test-rlimit-util.c b/src/test/test-rlimit-util.c index 62afd2de5e..7a3ed8354d 100644 --- a/src/test/test-rlimit-util.c +++ b/src/test/test-rlimit-util.c @@ -17,12 +17,12 @@ #include <sys/resource.h> -#include "alloc-util.h" -#include "capability-util.h" -#include "macro.h" -#include "rlimit-util.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/capability-util.h" +#include "basic/macro.h" +#include "basic/rlimit-util.h" +#include "basic/string-util.h" +#include "basic/util.h" static void test_rlimit_parse_format(int resource, const char *string, rlim_t soft, rlim_t hard, int ret, const char *formatted) { _cleanup_free_ char *f = NULL; diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c index c068f5c39e..a0f46ad1c9 100644 --- a/src/test/test-sched-prio.c +++ b/src/test/test-sched-prio.c @@ -19,11 +19,12 @@ #include <sched.h> -#include "macro.h" +#include "basic/macro.h" +#include "basic/rm-rf.h" #include "manager.h" -#include "rm-rf.h" +#include "shared/tests.h" + #include "test-helper.h" -#include "tests.h" int main(int argc, char *argv[]) { _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL; diff --git a/src/test/test-selinux.c b/src/test/test-selinux.c index 7545ad3764..326c24e6c4 100644 --- a/src/test/test-selinux.c +++ b/src/test/test-selinux.c @@ -19,13 +19,13 @@ #include <sys/stat.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "log.h" -#include "selinux-util.h" -#include "string-util.h" -#include "time-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/log.h" +#include "basic/selinux-util.h" +#include "basic/string-util.h" +#include "basic/time-util.h" +#include "basic/util.h" static void test_testing(void) { bool b; diff --git a/src/test/test-set.c b/src/test/test-set.c index 0ee5ddcc9f..59f3366b44 100644 --- a/src/test/test-set.c +++ b/src/test/test-set.c @@ -17,7 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "set.h" +#include "basic/set.h" static void test_set_steal_first(void) { _cleanup_set_free_ Set *m = NULL; diff --git a/src/test/test-sigbus.c b/src/test/test-sigbus.c index 17b81747be..ecbb0f87ea 100644 --- a/src/test/test-sigbus.c +++ b/src/test/test-sigbus.c @@ -19,9 +19,9 @@ #include <sys/mman.h> -#include "fd-util.h" -#include "sigbus.h" -#include "util.h" +#include "basic/fd-util.h" +#include "basic/sigbus.h" +#include "basic/util.h" int main(int argc, char *argv[]) { _cleanup_close_ int fd = -1; diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c index 671eb869cb..74e34394ab 100644 --- a/src/test/test-signal-util.c +++ b/src/test/test-signal-util.c @@ -20,8 +20,8 @@ #include <signal.h> #include <unistd.h> -#include "macro.h" -#include "signal-util.h" +#include "basic/macro.h" +#include "basic/signal-util.h" static void test_block_signals(void) { sigset_t ss; diff --git a/src/test/test-siphash24.c b/src/test/test-siphash24.c index b74b7ad2dd..2c40776dd0 100644 --- a/src/test/test-siphash24.c +++ b/src/test/test-siphash24.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "siphash24.h" -#include "util.h" +#include "basic/siphash24.h" +#include "basic/util.h" #define ITERATIONS 10000000ULL diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c index 8f99a13772..6869846e98 100644 --- a/src/test/test-sizeof.c +++ b/src/test/test-sizeof.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "log.h" -#include "time-util.h" +#include "basic/log.h" +#include "basic/time-util.h" /* Print information about various types. Useful when diagnosing * gcc diagnostics on an unfamiliar architecture. */ diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c index 97b6f3015d..b8ddc53ed0 100644 --- a/src/test/test-sleep.c +++ b/src/test/test-sleep.c @@ -19,10 +19,10 @@ #include <stdio.h> -#include "log.h" -#include "sleep-config.h" -#include "strv.h" -#include "util.h" +#include "basic/log.h" +#include "basic/strv.h" +#include "basic/util.h" +#include "shared/sleep-config.h" static void test_sleep(void) { _cleanup_strv_free_ char diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index b480fdaa9c..c7b5384ab8 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -17,15 +17,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "async.h" -#include "fd-util.h" -#include "in-addr-util.h" -#include "log.h" -#include "macro.h" -#include "socket-util.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/async.h" +#include "basic/fd-util.h" +#include "basic/in-addr-util.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/socket-util.h" +#include "basic/string-util.h" +#include "basic/util.h" static void test_ifname_valid(void) { assert(ifname_valid("foo")); diff --git a/src/test/test-stat-util.c b/src/test/test-stat-util.c index a10227f823..941a38b1fb 100644 --- a/src/test/test-stat-util.c +++ b/src/test/test-stat-util.c @@ -20,11 +20,11 @@ #include <fcntl.h> #include <unistd.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "macro.h" -#include "stat-util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/macro.h" +#include "basic/stat-util.h" static void test_files_same(void) { _cleanup_close_ int fd = -1; diff --git a/src/test/test-strbuf.c b/src/test/test-strbuf.c index 513218c397..74b5c03f7b 100644 --- a/src/test/test-strbuf.c +++ b/src/test/test-strbuf.c @@ -20,10 +20,10 @@ #include <stdlib.h> #include <string.h> -#include "strbuf.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/strbuf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" static ssize_t add_string(struct strbuf *sb, const char *s) { return strbuf_add_string(sb, s, strlen(s)); diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c index d0f84d70bc..7f867a2ced 100644 --- a/src/test/test-string-util.c +++ b/src/test/test-string-util.c @@ -17,10 +17,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "macro.h" -#include "string-util.h" -#include "strv.h" +#include "basic/alloc-util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/strv.h" static void test_string_erase(void) { char *x; diff --git a/src/test/test-strip-tab-ansi.c b/src/test/test-strip-tab-ansi.c index 72b0f6fc11..a9569e527b 100644 --- a/src/test/test-strip-tab-ansi.c +++ b/src/test/test-strip-tab-ansi.c @@ -19,9 +19,9 @@ #include <stdio.h> -#include "string-util.h" -#include "terminal-util.h" -#include "util.h" +#include "basic/string-util.h" +#include "basic/terminal-util.h" +#include "basic/util.h" int main(int argc, char *argv[]) { char *p; diff --git a/src/test/test-strv.c b/src/test/test-strv.c index fc01dcfaf1..3ecca8cfee 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -20,11 +20,11 @@ #include <string.h> -#include "alloc-util.h" -#include "specifier.h" -#include "string-util.h" -#include "strv.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/util.h" +#include "shared/specifier.h" static void test_specifier_printf(void) { static const Specifier table[] = { diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c index 9bea770131..b5c6d5f191 100644 --- a/src/test/test-strxcpyx.c +++ b/src/test/test-strxcpyx.c @@ -19,9 +19,9 @@ #include <string.h> -#include "string-util.h" -#include "strxcpyx.h" -#include "util.h" +#include "basic/string-util.h" +#include "basic/strxcpyx.h" +#include "basic/util.h" static void test_strpcpy(void) { char target[25]; diff --git a/src/test/test-tables.c b/src/test/test-tables.c index 0be74921fc..51ac9632f8 100644 --- a/src/test/test-tables.c +++ b/src/test/test-tables.c @@ -17,37 +17,37 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "architecture.h" #include "automount.h" +#include "basic/architecture.h" +#include "basic/locale-util.h" +#include "basic/log.h" +#include "basic/rlimit-util.h" +#include "basic/socket-util.h" +#include "basic/unit-name.h" +#include "basic/util.h" #include "busname.h" #include "cgroup.h" -#include "compress.h" -#include "condition.h" #include "device.h" #include "execute.h" -#include "install.h" #include "job.h" #include "journald-server.h" #include "kill.h" #include "link-config.h" -#include "locale-util.h" -#include "log.h" -#include "logs-show.h" #include "mount.h" #include "path.h" -#include "rlimit-util.h" #include "scope.h" +#include "sd-journal/compress.h" #include "service.h" +#include "shared/condition.h" +#include "shared/install.h" +#include "shared/logs-show.h" +#include "shared/test-tables.h" #include "slice.h" -#include "socket-util.h" #include "socket.h" #include "swap.h" #include "target.h" -#include "test-tables.h" #include "timer.h" -#include "unit-name.h" #include "unit.h" -#include "util.h" int main(int argc, char **argv) { test_table(architecture, ARCHITECTURE); diff --git a/src/test/test-terminal-util.c b/src/test/test-terminal-util.c index 84b448a095..bcdc048196 100644 --- a/src/test/test-terminal-util.c +++ b/src/test/test-terminal-util.c @@ -21,12 +21,12 @@ #include <stdbool.h> #include <stdio.h> -#include "fd-util.h" -#include "fileio.h" -#include "log.h" -#include "macro.h" -#include "terminal-util.h" -#include "util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/terminal-util.h" +#include "basic/util.h" static void test_default_term_for_tty(void) { puts(default_term_for_tty("/dev/tty23")); diff --git a/src/test/test-time.c b/src/test/test-time.c index ee7d55c5ab..d6ff1f958f 100644 --- a/src/test/test-time.c +++ b/src/test/test-time.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "strv.h" -#include "time-util.h" +#include "basic/strv.h" +#include "basic/time-util.h" static void test_parse_sec(void) { usec_t u; diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c index b34ebeefb2..df262e0b92 100644 --- a/src/test/test-tmpfiles.c +++ b/src/test/test-tmpfiles.c @@ -22,14 +22,14 @@ #include <stdlib.h> #include <unistd.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "formats-util.h" -#include "fs-util.h" -#include "log.h" -#include "string-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/formats-util.h" +#include "basic/fs-util.h" +#include "basic/log.h" +#include "basic/string-util.h" +#include "basic/util.h" int main(int argc, char** argv) { _cleanup_free_ char *cmd = NULL, *cmd2 = NULL, *ans = NULL, *ans2 = NULL, *d = NULL, *tmp = NULL, *line = NULL; diff --git a/src/test/test-udev.c b/src/test/test-udev.c index e965b4494a..1f6dc878c8 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -26,13 +26,13 @@ #include <sys/signalfd.h> #include <unistd.h> -#include "fs-util.h" -#include "log.h" -#include "missing.h" -#include "selinux-util.h" -#include "signal-util.h" -#include "string-util.h" -#include "udev-util.h" +#include "basic/fs-util.h" +#include "basic/log.h" +#include "basic/missing.h" +#include "basic/selinux-util.h" +#include "basic/signal-util.h" +#include "basic/string-util.h" +#include "shared/udev-util.h" #include "udev.h" static int fake_filesystems(void) { diff --git a/src/test/test-uid-range.c b/src/test/test-uid-range.c index 41f06a5cec..bb79ae6c3e 100644 --- a/src/test/test-uid-range.c +++ b/src/test/test-uid-range.c @@ -19,10 +19,10 @@ #include <stddef.h> -#include "alloc-util.h" -#include "uid-range.h" -#include "user-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/user-util.h" +#include "basic/util.h" +#include "shared/uid-range.h" int main(int argc, char *argv[]) { _cleanup_free_ UidRange *p = NULL; diff --git a/src/test/test-unaligned.c b/src/test/test-unaligned.c index b18b3fca0e..82151638d2 100644 --- a/src/test/test-unaligned.c +++ b/src/test/test-unaligned.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "sparse-endian.h" -#include "unaligned.h" -#include "util.h" +#include "basic/sparse-endian.h" +#include "basic/unaligned.h" +#include "basic/util.h" static uint8_t data[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c index ade0ff2a63..ba21dbcc83 100644 --- a/src/test/test-unit-file.c +++ b/src/test/test-unit-file.c @@ -25,24 +25,25 @@ #include <sys/capability.h> #include <unistd.h> -#include "alloc-util.h" -#include "capability-util.h" -#include "fd-util.h" -#include "fileio.h" -#include "hashmap.h" -#include "hostname-util.h" -#include "install-printf.h" -#include "install.h" +#include "basic/alloc-util.h" +#include "basic/capability-util.h" +#include "basic/fd-util.h" +#include "basic/fileio.h" +#include "basic/hashmap.h" +#include "basic/hostname-util.h" +#include "basic/macro.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/strv.h" +#include "basic/user-util.h" +#include "basic/util.h" #include "load-fragment.h" -#include "macro.h" -#include "rm-rf.h" -#include "specifier.h" -#include "string-util.h" -#include "strv.h" +#include "shared/install-printf.h" +#include "shared/install.h" +#include "shared/specifier.h" +#include "shared/tests.h" + #include "test-helper.h" -#include "tests.h" -#include "user-util.h" -#include "util.h" static int test_unit_file_get_set(void) { int r; diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index 2fd83f321c..e17355eac1 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -24,20 +24,21 @@ #include <stdlib.h> #include <string.h> -#include "alloc-util.h" -#include "glob-util.h" -#include "hostname-util.h" -#include "macro.h" +#include "basic/alloc-util.h" +#include "basic/glob-util.h" +#include "basic/hostname-util.h" +#include "basic/macro.h" +#include "basic/path-util.h" +#include "basic/string-util.h" +#include "basic/unit-name.h" +#include "basic/user-util.h" +#include "basic/util.h" #include "manager.h" -#include "path-util.h" -#include "specifier.h" -#include "string-util.h" -#include "test-helper.h" -#include "unit-name.h" +#include "shared/specifier.h" #include "unit-printf.h" #include "unit.h" -#include "user-util.h" -#include "util.h" + +#include "test-helper.h" static void test_unit_name_is_valid(void) { assert_se(unit_name_is_valid("foo.service", UNIT_NAME_ANY)); diff --git a/src/test/test-user-util.c b/src/test/test-user-util.c index 8d1ec19f17..8460396b2c 100644 --- a/src/test/test-user-util.c +++ b/src/test/test-user-util.c @@ -17,11 +17,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "macro.h" -#include "string-util.h" -#include "user-util.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/user-util.h" +#include "basic/util.h" static void test_uid_to_name_one(uid_t uid, const char *name) { _cleanup_free_ char *t = NULL; diff --git a/src/test/test-utf8.c b/src/test/test-utf8.c index 1ce5a5a24d..e6cfdac8ed 100644 --- a/src/test/test-utf8.c +++ b/src/test/test-utf8.c @@ -17,10 +17,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "alloc-util.h" -#include "string-util.h" -#include "utf8.h" -#include "util.h" +#include "basic/alloc-util.h" +#include "basic/string-util.h" +#include "basic/utf8.h" +#include "basic/util.h" static void test_utf8_is_printable(void) { assert_se(utf8_is_printable("ascii is valid\tunicode", 22)); diff --git a/src/test/test-util.c b/src/test/test-util.c index 05cb1eae76..13f6b2f953 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -23,12 +23,12 @@ #include <sys/wait.h> #include <unistd.h> -#include "def.h" -#include "fileio.h" -#include "fs-util.h" -#include "rm-rf.h" -#include "string-util.h" -#include "util.h" +#include "basic/def.h" +#include "basic/fileio.h" +#include "basic/fs-util.h" +#include "basic/rm-rf.h" +#include "basic/string-util.h" +#include "basic/util.h" static void test_align_power2(void) { unsigned long i, p2; diff --git a/src/test/test-verbs.c b/src/test/test-verbs.c index 0fcdd9e78d..01a0ded37b 100644 --- a/src/test/test-verbs.c +++ b/src/test/test-verbs.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "macro.h" -#include "strv.h" -#include "verbs.h" +#include "basic/macro.h" +#include "basic/strv.h" +#include "basic/verbs.h" static int noop_dispatcher(int argc, char *argv[], void *userdata) { return 0; diff --git a/src/test/test-watchdog.c b/src/test/test-watchdog.c index e3c19647fc..64814fc174 100644 --- a/src/test/test-watchdog.c +++ b/src/test/test-watchdog.c @@ -19,8 +19,8 @@ #include <unistd.h> -#include "log.h" -#include "watchdog.h" +#include "basic/log.h" +#include "shared/watchdog.h" int main(int argc, char *argv[]) { usec_t t = 10 * USEC_PER_SEC; diff --git a/src/test/test-web-util.c b/src/test/test-web-util.c index 79a3a13af6..4907a5544c 100644 --- a/src/test/test-web-util.c +++ b/src/test/test-web-util.c @@ -17,8 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "macro.h" -#include "web-util.h" +#include "basic/macro.h" +#include "basic/web-util.h" static void test_is_valid_documentation_url(void) { assert_se(documentation_url_is_valid("http://www.freedesktop.org/wiki/Software/systemd")); diff --git a/src/test/test-xattr-util.c b/src/test/test-xattr-util.c index 267f29426c..1a78e54d3c 100644 --- a/src/test/test-xattr-util.c +++ b/src/test/test-xattr-util.c @@ -23,12 +23,12 @@ #include <sys/xattr.h> #include <unistd.h> -#include "alloc-util.h" -#include "fd-util.h" -#include "fs-util.h" -#include "macro.h" -#include "string-util.h" -#include "xattr-util.h" +#include "basic/alloc-util.h" +#include "basic/fd-util.h" +#include "basic/fs-util.h" +#include "basic/macro.h" +#include "basic/string-util.h" +#include "basic/xattr-util.h" static void test_fgetxattrat_fake(void) { char t[] = "/var/tmp/xattrtestXXXXXX"; diff --git a/src/test/test-xml.c b/src/test/test-xml.c index b0b72fa78a..22e92b2075 100644 --- a/src/test/test-xml.c +++ b/src/test/test-xml.c @@ -19,10 +19,10 @@ #include <stdarg.h> -#include "alloc-util.h" -#include "string-util.h" -#include "util.h" -#include "xml.h" +#include "basic/alloc-util.h" +#include "basic/string-util.h" +#include "basic/util.h" +#include "basic/xml.h" static void test_one(const char *data, ...) { void *state = NULL; |