diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-03-27 11:32:41 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-03-27 11:53:12 +0100 |
commit | ca78ad1de987b800978622a22ac6c5caf628a037 (patch) | |
tree | 9445e8e303fbb8f52aaccf6cd280b7cd957dc97e /src/test | |
parent | test-fileio: do not use variable before checking return value (diff) | |
download | systemd-ca78ad1de987b800978622a22ac6c5caf628a037.tar.xz systemd-ca78ad1de987b800978622a22ac6c5caf628a037.zip |
headers: remove unneeded includes from util.h
This means we need to include many more headers in various files that simply
included util.h before, but it seems cleaner to do it this way.
Diffstat (limited to 'src/test')
27 files changed, 45 insertions, 9 deletions
diff --git a/src/test/test-async.c b/src/test/test-async.c index 4f5307889e..7d8accc2fc 100644 --- a/src/test/test-async.c +++ b/src/test/test-async.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <fcntl.h> #include <unistd.h> #include "async.h" diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c index 6469129fa4..10417f662f 100644 --- a/src/test/test-barrier.c +++ b/src/test/test-barrier.c @@ -18,6 +18,7 @@ #include "util.h" #include "tests.h" #include "virt.h" +#include "time-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-boot-timestamps.c b/src/test/test-boot-timestamps.c index a79e0cf16b..79b8dd49a7 100644 --- a/src/test/test-boot-timestamps.c +++ b/src/test/test-boot-timestamps.c @@ -1,5 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <sys/types.h> +#include <unistd.h> + #include "acpi-fpdt.h" #include "boot-timestamps.h" #include "efivars.h" diff --git a/src/test/test-cap-list.c b/src/test/test-cap-list.c index de5fa729cc..563b996941 100644 --- a/src/test/test-cap-list.c +++ b/src/test/test-cap-list.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <stdio.h> #include <sys/prctl.h> #include "alloc-util.h" diff --git a/src/test/test-daemon.c b/src/test/test-daemon.c index a4b96da045..6ca821581f 100644 --- a/src/test/test-daemon.c +++ b/src/test/test-daemon.c @@ -6,6 +6,7 @@ #include "parse-util.h" #include "strv.h" +#include "time-util.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 cba51e225c..9888b65998 100644 --- a/src/test/test-date.c +++ b/src/test/test-date.c @@ -5,7 +5,7 @@ #include "alloc-util.h" #include "string-util.h" #include "tests.h" -#include "util.h" +#include "time-util.h" static void test_should_pass(const char *p) { usec_t t, q; diff --git a/src/test/test-fstab-util.c b/src/test/test-fstab-util.c index bd873a39be..4cd504e45c 100644 --- a/src/test/test-fstab-util.c +++ b/src/test/test-fstab-util.c @@ -1,10 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <stdio.h> + #include "alloc-util.h" #include "fstab-util.h" #include "log.h" #include "string-util.h" -#include "util.h" /* int fstab_filter_options(const char *opts, const char *names, diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 325c3b32cc..fdb0c7e87f 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -7,6 +7,7 @@ #include "stdio-util.h" #include "string-util.h" #include "strv.h" +#include "time-util.h" #include "tests.h" void test_hashmap_funcs(void); diff --git a/src/test/test-hostname-util.c b/src/test/test-hostname-util.c index 4126a24ceb..ec34f9cd71 100644 --- a/src/test/test-hostname-util.c +++ b/src/test/test-hostname-util.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <unistd.h> + #include "alloc-util.h" #include "fileio.h" #include "hostname-util.h" diff --git a/src/test/test-id128.c b/src/test/test-id128.c index ec50e057a3..8840788310 100644 --- a/src/test/test-id128.c +++ b/src/test/test-id128.c @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <fcntl.h> #include <string.h> +#include <sys/types.h> +#include <unistd.h> #include "sd-daemon.h" #include "sd-id128.h" diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c index 73ea68f372..cfddfe19a7 100644 --- a/src/test/test-install-root.c +++ b/src/test/test-install-root.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <unistd.h> + #include "alloc-util.h" #include "fileio.h" #include "install.h" diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index f1d044082b..28d90be896 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -4,6 +4,7 @@ #include "locale-util.h" #include "macro.h" #include "strv.h" +#include "util.h" static void test_get_locales(void) { _cleanup_strv_free_ char **locales = NULL; diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c index be76429506..8c5aac8eb7 100644 --- a/src/test/test-mountpoint-util.c +++ b/src/test/test-mountpoint-util.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include <sys/mount.h> +#include <unistd.h> #include "alloc-util.h" #include "def.h" diff --git a/src/test/test-namespace.c b/src/test/test-namespace.c index cc2efecfd2..73ad2b25dd 100644 --- a/src/test/test-namespace.c +++ b/src/test/test-namespace.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include <sys/socket.h> +#include <sys/stat.h> #include "alloc-util.h" #include "fd-util.h" diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c index 1ebe8d1972..a1a5eb4778 100644 --- a/src/test/test-netlink-manual.c +++ b/src/test/test-netlink-manual.c @@ -5,6 +5,8 @@ #include <linux/ip.h> #include <net/if.h> #include <linux/if_tunnel.h> +#include <sys/types.h> +#include <unistd.h> #include "sd-netlink.h" diff --git a/src/test/test-nss.c b/src/test/test-nss.c index f1bba2a353..27afe36082 100644 --- a/src/test/test-nss.c +++ b/src/test/test-nss.c @@ -3,6 +3,7 @@ #include <dlfcn.h> #include <net/if.h> #include <stdlib.h> +#include <unistd.h> #include "af-list.h" #include "alloc-util.h" diff --git a/src/test/test-pretty-print.c b/src/test/test-pretty-print.c index 53ec512ec3..3ad80d145d 100644 --- a/src/test/test-pretty-print.c +++ b/src/test/test-pretty-print.c @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include <stdio.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> #include "alloc-util.h" #include "macro.h" diff --git a/src/test/test-replace-var.c b/src/test/test-replace-var.c index 55208b179f..8620e72b2b 100644 --- a/src/test/test-replace-var.c +++ b/src/test/test-replace-var.c @@ -1,11 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include <string.h> +#include <stdio.h> #include "macro.h" #include "replace-var.h" #include "string-util.h" -#include "util.h" static char *lookup(const char *variable, void *userdata) { return strjoin("<<<", variable, ">>>"); diff --git a/src/test/test-rlimit-util.c b/src/test/test-rlimit-util.c index 771719a267..fac30126ce 100644 --- a/src/test/test-rlimit-util.c +++ b/src/test/test-rlimit-util.c @@ -8,7 +8,7 @@ #include "missing.h" #include "rlimit-util.h" #include "string-util.h" -#include "util.h" +#include "time-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-sleep.c b/src/test/test-sleep.c index 618da6e40d..e0c513ad8c 100644 --- a/src/test/test-sleep.c +++ b/src/test/test-sleep.c @@ -1,8 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <fcntl.h> #include <inttypes.h> #include <linux/fiemap.h> #include <stdio.h> +#include <sys/types.h> +#include <unistd.h> #include "fd-util.h" #include "log.h" @@ -10,6 +13,7 @@ #include "sleep-config.h" #include "strv.h" #include "tests.h" +#include "util.h" static void test_parse_sleep_config(void) { const char *verb; diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index cd4e784894..057840d76f 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <fcntl.h> +#include <grp.h> +#include <sys/stat.h> #include <sys/types.h> #include <unistd.h> -#include <grp.h> #include "alloc-util.h" #include "async.h" @@ -19,7 +21,6 @@ #include "string-util.h" #include "tests.h" #include "tmpfile-util.h" -#include "util.h" static void test_ifname_valid(void) { log_info("/* %s */", __func__); diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c index 8c1f91d4ef..064a5abdac 100644 --- a/src/test/test-string-util.c +++ b/src/test/test-string-util.c @@ -7,6 +7,7 @@ #include "strv.h" #include "tests.h" #include "utf8.h" +#include "util.h" static void test_string_erase(void) { char *x; diff --git a/src/test/test-terminal-util.c b/src/test/test-terminal-util.c index e510b737c7..8cd580e719 100644 --- a/src/test/test-terminal-util.c +++ b/src/test/test-terminal-util.c @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <fcntl.h> #include <stdbool.h> #include <stdio.h> +#include <unistd.h> #include "alloc-util.h" #include "fd-util.h" diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c index 6b01529068..8a0251e13a 100644 --- a/src/test/test-unit-file.c +++ b/src/test/test-unit-file.c @@ -13,6 +13,7 @@ #include "conf-parser.h" #include "env-file.h" #include "fd-util.h" +#include "format-util.h" #include "fs-util.h" #include "hashmap.h" #include "hostname-util.h" diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index 959d6d4614..fd2443e3cb 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -8,6 +8,7 @@ #include "alloc-util.h" #include "all-units.h" #include "glob-util.h" +#include "format-util.h" #include "hostname-util.h" #include "macro.h" #include "manager.h" diff --git a/src/test/test-user-util.c b/src/test/test-user-util.c index 801824ad67..1a507bc00a 100644 --- a/src/test/test-user-util.c +++ b/src/test/test-user-util.c @@ -1,12 +1,12 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include "alloc-util.h" +#include "format-util.h" #include "log.h" #include "macro.h" +#include "path-util.h" #include "string-util.h" #include "user-util.h" -#include "util.h" -#include "path-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-verbs.c b/src/test/test-verbs.c index efb9664b3c..24593c75d9 100644 --- a/src/test/test-verbs.c +++ b/src/test/test-verbs.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include <getopt.h> + #include "macro.h" #include "strv.h" #include "verbs.h" |