summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-08-01 16:33:32 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-08-01 16:33:32 -0400
commit272b48187cee0b42b6e936ad2c045f13b391f3ad (patch)
tree383049270ccbac5040e4404bbe71ac49d0c423db /src/test
parent46277a7844c854210eaa0a3612fa297ec33ddb7b (diff)
find src \( -name '*.h' -o -name '*.c' \) -type f -exec ./fixup_includes {} \;
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-acl-util.c2
-rw-r--r--src/test/test-ask-password-api.c2
-rw-r--r--src/test/test-boot-timestamps.c4
-rw-r--r--src/test/test-cgroup-mask.c5
-rw-r--r--src/test/test-cgroup-util.c3
-rw-r--r--src/test/test-clock.c2
-rw-r--r--src/test/test-condition.c6
-rw-r--r--src/test/test-conf-parser.c2
-rw-r--r--src/test/test-dns-domain.c2
-rw-r--r--src/test/test-engine.c7
-rw-r--r--src/test/test-execute.c7
-rw-r--r--src/test/test-fileio.c2
-rw-r--r--src/test/test-firewall-util.c2
-rw-r--r--src/test/test-fs-util.c2
-rw-r--r--src/test/test-fstab-util.c2
-rw-r--r--src/test/test-hostname.c2
-rw-r--r--src/test/test-install-root.c2
-rw-r--r--src/test/test-ipcrm.c2
-rw-r--r--src/test/test-libudev.c4
-rw-r--r--src/test/test-namespace.c2
-rw-r--r--src/test/test-netlink-manual.c2
-rw-r--r--src/test/test-nss.c18
-rw-r--r--src/test/test-path-lookup.c2
-rw-r--r--src/test/test-path.c7
-rw-r--r--src/test/test-sched-prio.c5
-rw-r--r--src/test/test-sleep.c2
-rw-r--r--src/test/test-strv.c2
-rw-r--r--src/test/test-tables.c24
-rw-r--r--src/test/test-uid-range.c2
-rw-r--r--src/test/test-unit-file.c13
-rw-r--r--src/test/test-unit-name.c11
31 files changed, 79 insertions, 71 deletions
diff --git a/src/test/test-acl-util.c b/src/test/test-acl-util.c
index 8672f008b8..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 "shared/acl-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-ask-password-api.c b/src/test/test-ask-password-api.c
index b12f3c2e47..a93e821c7d 100644
--- a/src/test/test-ask-password-api.c
+++ b/src/test/test-ask-password-api.c
@@ -18,8 +18,8 @@
***/
#include "basic/alloc-util.h"
-#include "shared/ask-password-api.h"
#include "basic/log.h"
+#include "shared/ask-password-api.h"
static void ask_password(void) {
int r;
diff --git a/src/test/test-boot-timestamps.c b/src/test/test-boot-timestamps.c
index 5ac6cd16e3..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 "basic/log.h"
+#include "basic/util.h"
#include "shared/acpi-fpdt.h"
#include "shared/boot-timestamps.h"
#include "shared/efivars.h"
-#include "basic/log.h"
-#include "basic/util.h"
static int test_acpi_fpdt(void) {
usec_t loader_start;
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c
index 30c3ec9ae6..6d889c98d2 100644
--- a/src/test/test-cgroup-mask.c
+++ b/src/test/test-cgroup-mask.c
@@ -20,12 +20,13 @@
#include <stdio.h>
#include "basic/macro.h"
-#include "manager.h"
#include "basic/rm-rf.h"
-#include "test-helper.h"
+#include "manager.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 0b37414bf8..394839bc83 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -25,10 +25,11 @@
#include "basic/parse-util.h"
#include "basic/process-util.h"
#include "basic/string-util.h"
-#include "test-helper.h"
#include "basic/user-util.h"
#include "basic/util.h"
+#include "test-helper.h"
+
static void check_p_d_u(const char *path, int code, const char *result) {
_cleanup_free_ char *unit = NULL;
int r;
diff --git a/src/test/test-clock.c b/src/test/test-clock.c
index 49dec49366..c6a8e7aa1c 100644
--- a/src/test/test-clock.c
+++ b/src/test/test-clock.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <fcntl.h>
+#include <unistd.h>
#include "basic/clock-util.h"
#include "basic/fd-util.h"
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index 868e1dcf8d..00a86dedda 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -20,17 +20,17 @@
#include <systemd/sd-id128.h>
#include "basic/alloc-util.h"
-#include "shared/apparmor-util.h"
#include "basic/architecture.h"
#include "basic/audit-util.h"
-#include "shared/condition.h"
#include "basic/hostname-util.h"
-#include "shared/ima-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-parser.c b/src/test/test-conf-parser.c
index 5b63e60b32..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 "shared/conf-parser.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-dns-domain.c b/src/test/test-dns-domain.c
index 6165948314..930bd5dd62 100644
--- a/src/test/test-dns-domain.c
+++ b/src/test/test-dns-domain.c
@@ -18,9 +18,9 @@
***/
#include "basic/alloc-util.h"
-#include "shared/dns-domain.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-engine.c b/src/test/test-engine.c
index 86f8b0d335..9d21bb5723 100644
--- a/src/test/test-engine.c
+++ b/src/test/test-engine.c
@@ -21,12 +21,13 @@
#include <stdio.h>
#include <string.h>
-#include "shared/bus-util.h"
-#include "manager.h"
#include "basic/rm-rf.h"
-#include "test-helper.h"
+#include "manager.h"
+#include "shared/bus-util.h"
#include "shared/tests.h"
+#include "test-helper.h"
+
int main(int argc, char *argv[]) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
_cleanup_(sd_bus_error_free) sd_bus_error err = SD_BUS_ERROR_NULL;
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index de7b772a0d..7cd63168c8 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -26,13 +26,14 @@
#include "basic/fileio.h"
#include "basic/fs-util.h"
#include "basic/macro.h"
-#include "manager.h"
#include "basic/mkdir.h"
#include "basic/path-util.h"
#include "basic/rm-rf.h"
-#include "test-helper.h"
-#include "unit.h"
#include "basic/util.h"
+#include "manager.h"
+#include "unit.h"
+
+#include "test-helper.h"
typedef void (*test_function_t)(Manager *m);
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index 97f4622400..f5a99d668d 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -17,12 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <ctype.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include "basic/alloc-util.h"
-#include "ctype.h"
#include "basic/def.h"
#include "basic/env-util.h"
#include "basic/fd-util.h"
diff --git a/src/test/test-firewall-util.c b/src/test/test-firewall-util.c
index 895c1bb7b0..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 "firewall-util.h"
#include "basic/log.h"
+#include "firewall-util.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 e3e6d19d92..7002eb841a 100644
--- a/src/test/test-fs-util.c
+++ b/src/test/test-fs-util.c
@@ -20,8 +20,8 @@
#include <unistd.h>
#include "basic/alloc-util.h"
-#include "basic/fileio.h"
#include "basic/fd-util.h"
+#include "basic/fileio.h"
#include "basic/fs-util.h"
#include "basic/macro.h"
#include "basic/mkdir.h"
diff --git a/src/test/test-fstab-util.c b/src/test/test-fstab-util.c
index 42c7368801..181ff230e0 100644
--- a/src/test/test-fstab-util.c
+++ b/src/test/test-fstab-util.c
@@ -18,10 +18,10 @@
***/
#include "basic/alloc-util.h"
-#include "shared/fstab-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-hostname.c b/src/test/test-hostname.c
index 28ae8b96fb..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 "hostname-setup.h"
#include "basic/util.h"
+#include "hostname-setup.h"
int main(int argc, char* argv[]) {
int r;
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c
index 69eb85593b..c0d696dcdc 100644
--- a/src/test/test-install-root.c
+++ b/src/test/test-install-root.c
@@ -19,10 +19,10 @@
#include "basic/alloc-util.h"
#include "basic/fileio.h"
-#include "shared/install.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-ipcrm.c b/src/test/test-ipcrm.c
index 8ca3952bf5..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 "shared/clean-ipc.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 40205ecb8c..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 <libudev.h>
#include "basic/fd-util.h"
#include "basic/log.h"
#include "basic/stdio-util.h"
#include "basic/string-util.h"
-#include "shared/udev-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-namespace.c b/src/test/test-namespace.c
index 23992ab431..d877c61756 100644
--- a/src/test/test-namespace.c
+++ b/src/test/test-namespace.c
@@ -21,10 +21,10 @@
#include "basic/alloc-util.h"
#include "basic/fd-util.h"
-#include "namespace.h"
#include "basic/process-util.h"
#include "basic/string-util.h"
#include "basic/util.h"
+#include "namespace.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 d7cb3b2c87..6efdd33660 100644
--- a/src/test/test-netlink-manual.c
+++ b/src/test/test-netlink-manual.c
@@ -19,9 +19,9 @@
#include <arpa/inet.h>
#include <libkmod.h>
+#include <linux/if_tunnel.h>
#include <linux/ip.h>
#include <net/if.h>
-#include <linux/if_tunnel.h>
#include "basic/macro.h"
#include "basic/util.h"
diff --git a/src/test/test-nss.c b/src/test/test-nss.c
index df617bc680..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 "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/string-util.h"
-#include "basic/alloc-util.h"
-#include "basic/in-addr-util.h"
-#include "basic/hexdecoct.h"
-#include "basic/af-list.h"
#include "basic/stdio-util.h"
+#include "basic/string-util.h"
#include "basic/strv.h"
-#include "basic/errno-list.h"
-#include "basic/hostname-util.h"
-#include "local-addresses.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-path-lookup.c b/src/test/test-path-lookup.c
index 41eb48d787..6c6315bf2d 100644
--- a/src/test/test-path-lookup.c
+++ b/src/test/test-path-lookup.c
@@ -21,10 +21,10 @@
#include <sys/stat.h>
#include "basic/log.h"
-#include "shared/path-lookup.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.c b/src/test/test-path.c
index ed87cfdb8f..1cd09c89d8 100644
--- a/src/test/test-path.c
+++ b/src/test/test-path.c
@@ -24,15 +24,16 @@
#include "basic/fd-util.h"
#include "basic/fs-util.h"
#include "basic/macro.h"
-#include "manager.h"
#include "basic/mkdir.h"
#include "basic/rm-rf.h"
#include "basic/string-util.h"
#include "basic/strv.h"
-#include "test-helper.h"
+#include "basic/util.h"
+#include "manager.h"
#include "shared/tests.h"
#include "unit.h"
-#include "basic/util.h"
+
+#include "test-helper.h"
typedef void (*test_function_t)(Manager *m);
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c
index 33249fe12c..a0f46ad1c9 100644
--- a/src/test/test-sched-prio.c
+++ b/src/test/test-sched-prio.c
@@ -20,11 +20,12 @@
#include <sched.h>
#include "basic/macro.h"
-#include "manager.h"
#include "basic/rm-rf.h"
-#include "test-helper.h"
+#include "manager.h"
#include "shared/tests.h"
+#include "test-helper.h"
+
int main(int argc, char *argv[]) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
Manager *m = NULL;
diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c
index 9260428d04..b8ddc53ed0 100644
--- a/src/test/test-sleep.c
+++ b/src/test/test-sleep.c
@@ -20,9 +20,9 @@
#include <stdio.h>
#include "basic/log.h"
-#include "shared/sleep-config.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-strv.c b/src/test/test-strv.c
index 90fcb20cdd..3ecca8cfee 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -21,10 +21,10 @@
#include <string.h>
#include "basic/alloc-util.h"
-#include "shared/specifier.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-tables.c b/src/test/test-tables.c
index 2643a05648..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 "basic/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 "shared/condition.h"
#include "device.h"
#include "execute.h"
-#include "shared/install.h"
#include "job.h"
#include "journald-server.h"
#include "kill.h"
#include "link-config.h"
-#include "basic/locale-util.h"
-#include "basic/log.h"
-#include "shared/logs-show.h"
#include "mount.h"
#include "path.h"
-#include "basic/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 "basic/socket-util.h"
#include "socket.h"
#include "swap.h"
#include "target.h"
-#include "shared/test-tables.h"
#include "timer.h"
-#include "basic/unit-name.h"
#include "unit.h"
-#include "basic/util.h"
int main(int argc, char **argv) {
test_table(architecture, ARCHITECTURE);
diff --git a/src/test/test-uid-range.c b/src/test/test-uid-range.c
index 50da66bde1..bb79ae6c3e 100644
--- a/src/test/test-uid-range.c
+++ b/src/test/test-uid-range.c
@@ -20,9 +20,9 @@
#include <stddef.h>
#include "basic/alloc-util.h"
-#include "shared/uid-range.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-unit-file.c b/src/test/test-unit-file.c
index 09481364b9..ba21dbcc83 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -31,18 +31,19 @@
#include "basic/fileio.h"
#include "basic/hashmap.h"
#include "basic/hostname-util.h"
-#include "shared/install-printf.h"
-#include "shared/install.h"
-#include "load-fragment.h"
#include "basic/macro.h"
#include "basic/rm-rf.h"
-#include "shared/specifier.h"
#include "basic/string-util.h"
#include "basic/strv.h"
-#include "test-helper.h"
-#include "shared/tests.h"
#include "basic/user-util.h"
#include "basic/util.h"
+#include "load-fragment.h"
+#include "shared/install-printf.h"
+#include "shared/install.h"
+#include "shared/specifier.h"
+#include "shared/tests.h"
+
+#include "test-helper.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 b4c91cfa6c..e17355eac1 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -28,16 +28,17 @@
#include "basic/glob-util.h"
#include "basic/hostname-util.h"
#include "basic/macro.h"
-#include "manager.h"
#include "basic/path-util.h"
-#include "shared/specifier.h"
#include "basic/string-util.h"
-#include "test-helper.h"
#include "basic/unit-name.h"
-#include "unit-printf.h"
-#include "unit.h"
#include "basic/user-util.h"
#include "basic/util.h"
+#include "manager.h"
+#include "shared/specifier.h"
+#include "unit-printf.h"
+#include "unit.h"
+
+#include "test-helper.h"
static void test_unit_name_is_valid(void) {
assert_se(unit_name_is_valid("foo.service", UNIT_NAME_ANY));