aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-02-20 10:14:15 -0500
committerNick Mathewson <nickm@torproject.org>2018-02-20 10:14:15 -0500
commit4438ef3288256e1f1ba706c157206a2ac190781d (patch)
tree3515fdc2c6f7b258c9fa81bb191e6bff90ecb66d /src/test
parenta4ab273a0dafdd85e8e9f204c6e3e092282d3620 (diff)
downloadtor-4438ef3288256e1f1ba706c157206a2ac190781d.tar.gz
tor-4438ef3288256e1f1ba706c157206a2ac190781d.zip
Remove a bunch of other redundant #includes
Folks have found two in the past week or so; we may as well fix the others. Found with: \#!/usr/bin/python3 import re def findMulti(fname): includes = set() with open(fname) as f: for line in f: m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line) if m: inc = m.group(1) if inc in includes: print("{}: {}".format(fname, inc)) includes.add(m.group(1)) import sys for fname in sys.argv[1:]: findMulti(fname)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_address.c6
-rw-r--r--src/test/test_config.c4
-rw-r--r--src/test/test_dir_handle_get.c1
-rw-r--r--src/test/test_helpers.c1
-rw-r--r--src/test/test_hs_intropoint.c1
-rw-r--r--src/test/testing_common.c2
6 files changed, 4 insertions, 11 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 9c88d37a41..0dd7b40334 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -11,8 +11,11 @@
#include <iphlpapi.h>
#endif
-#ifdef HAVE_IFADDRS_TO_SMARTLIST
+#ifdef HAVE_NET_IF_H
#include <net/if.h>
+#endif
+
+#ifdef HAVE_IFADDRS_TO_SMARTLIST
#include <ifaddrs.h>
#endif
@@ -20,7 +23,6 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
-#include <net/if.h>
#endif /* defined(HAVE_IFCONF_TO_SMARTLIST) */
#include "or.h"
diff --git a/src/test/test_config.c b/src/test/test_config.c
index d42335de38..3729c8aabb 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -20,7 +20,6 @@
#include "connection_edge.h"
#include "test.h"
#include "util.h"
-#include "address.h"
#include "connection_or.h"
#include "control.h"
#include "cpuworker.h"
@@ -42,9 +41,6 @@
#include "routerlist.h"
#include "routerset.h"
#include "statefile.h"
-#include "test.h"
-#include "transports.h"
-#include "util.h"
#include "test_helpers.h"
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index ca64dce5fe..71faf70af2 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -16,7 +16,6 @@
#include "directory.h"
#include "test.h"
#include "compress.h"
-#include "connection.h"
#include "rendcommon.h"
#include "rendcache.h"
#include "router.h"
diff --git a/src/test/test_helpers.c b/src/test/test_helpers.c
index 0da9cf64d0..ab453d3bdc 100644
--- a/src/test/test_helpers.c
+++ b/src/test/test_helpers.c
@@ -33,7 +33,6 @@ DISABLE_GCC_WARNING(overlength-strings)
* at large. */
#endif
#include "test_descriptors.inc"
-#include "or.h"
#include "circuitlist.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
ENABLE_GCC_WARNING(overlength-strings)
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c
index 55dfafbeac..fe3236c331 100644
--- a/src/test/test_hs_intropoint.c
+++ b/src/test/test_hs_intropoint.c
@@ -14,7 +14,6 @@
#include "test.h"
#include "log_test_helpers.h"
#include "crypto.h"
-#include "log_test_helpers.h"
#include "or.h"
#include "circuitlist.h"
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 52729147b2..b9b36d96d0 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -29,8 +29,6 @@
#include <dirent.h>
#endif /* defined(_WIN32) */
-#include "or.h"
-
#ifdef USE_DMALLOC
#include <dmalloc.h>
#include "main.h"