From 5807e4a873730fdb245b3c39913fc6acb3779f8a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 6 Jan 2019 17:04:21 +0100 Subject: Clean up includes --- test/ampatree_test.c | 4 ++-- test/bench.h | 2 +- test/bitset_test.c | 4 ++-- test/btree_test.c | 11 ++++++----- test/dict_bench.c | 16 ++++++++-------- test/hash_test.c | 10 +++++++--- test/patree_test.c | 4 ++-- test/ring_test.c | 8 ++++---- test/sem_test.c | 8 +++----- test/sorted_array_test.c | 8 ++++---- test/strindex_test.c | 4 ++-- test/test_malloc.c | 7 ++----- test/tree_bench.c | 8 ++++---- test/tree_test.c | 8 +++++--- test/trie_test.c | 4 ++-- 15 files changed, 54 insertions(+), 52 deletions(-) (limited to 'test') diff --git a/test/ampatree_test.c b/test/ampatree_test.c index 94379f6..1138b39 100644 --- a/test/ampatree_test.c +++ b/test/ampatree_test.c @@ -14,12 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "zix/ampatree.h" + #include #include #include -#include "zix/ampatree.h" - static const char* strings[] = { "http://example.org/foo", "http://example.org/bar", diff --git a/test/bench.h b/test/bench.h index 93d4002..3575633 100644 --- a/test/bench.h +++ b/test/bench.h @@ -16,8 +16,8 @@ #define _POSIX_C_SOURCE 199309L -#include #include +#include static inline double elapsed_s(const struct timespec* start, const struct timespec* end) diff --git a/test/bitset_test.c b/test/bitset_test.c index 0fbbcab..dbb7bd7 100644 --- a/test/bitset_test.c +++ b/test/bitset_test.c @@ -14,11 +14,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "zix/bitset.h" + #include #include -#include "zix/bitset.h" - #define N_BITS 256 #define N_ELEMS (ZIX_BITSET_ELEMS(N_BITS)) diff --git a/test/btree_test.c b/test/btree_test.c index 8257add..93a257f 100644 --- a/test/btree_test.c +++ b/test/btree_test.c @@ -14,12 +14,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include "zix/btree.h" + +#include "test_malloc.h" + +#include +#include #include #include #include #include -#include #ifdef _MSC_VER # define PRIdPTR "Id" @@ -27,9 +31,6 @@ # include #endif -#include "test_malloc.h" -#include "zix/zix.h" - static bool expect_failure = false; // Return a pseudo-pseudo-pseudo-random-ish integer with no duplicates diff --git a/test/dict_bench.c b/test/dict_bench.c index 228d25c..03be89e 100644 --- a/test/dict_bench.c +++ b/test/dict_bench.c @@ -16,20 +16,20 @@ #include "bench.h" -#include -#include -#include -#include -#include - -#include - #include "zix/ampatree.h" #include "zix/chunk.h" #include "zix/hash.h" #include "zix/patree.h" #include "zix/trie.h" +#include + +#include +#include +#include +#include +#include + static const unsigned seed = 1; static int diff --git a/test/hash_test.c b/test/hash_test.c index 7da514b..a24ae9c 100644 --- a/test/hash_test.c +++ b/test/hash_test.c @@ -14,13 +14,17 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "test_malloc.h" + +#include "zix/common.h" +#include "zix/hash.h" + #include +#include +#include #include #include -#include "test_malloc.h" -#include "zix/hash.h" - static bool expect_failure = false; static const char* strings[] = { diff --git a/test/patree_test.c b/test/patree_test.c index c28ec40..19df93f 100644 --- a/test/patree_test.c +++ b/test/patree_test.c @@ -14,12 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "zix/patree.h" + #include #include #include -#include "zix/patree.h" - static const char* strings[] = { "http://example.org/foo", "http://example.org/bar", diff --git a/test/ring_test.c b/test/ring_test.c index c1ab0fd..cabf6d3 100644 --- a/test/ring_test.c +++ b/test/ring_test.c @@ -14,14 +14,14 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "zix/ring.h" +#include "zix/thread.h" + #include #include +#include #include #include -#include - -#include "zix/ring.h" -#include "zix/thread.h" #define MSG_SIZE 20 diff --git a/test/sem_test.c b/test/sem_test.c index 9dffe1f..ff95664 100644 --- a/test/sem_test.c +++ b/test/sem_test.c @@ -14,14 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include -#include - #include "zix/sem.h" #include "zix/thread.h" +#include +#include + static ZixSem sem; static unsigned n_signals = 1024; diff --git a/test/sorted_array_test.c b/test/sorted_array_test.c index f1fa9a8..76745cf 100644 --- a/test/sorted_array_test.c +++ b/test/sorted_array_test.c @@ -14,7 +14,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include "zix/common.h" +#include "zix/sorted_array.h" + +#include #include #include #include @@ -26,9 +29,6 @@ # include #endif -#include "zix/common.h" -#include "zix/sorted_array.h" - static unsigned seed = 1; static int diff --git a/test/strindex_test.c b/test/strindex_test.c index b36f632..f8a5424 100644 --- a/test/strindex_test.c +++ b/test/strindex_test.c @@ -14,12 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "zix/strindex.h" + #include #include #include -#include "zix/strindex.h" - static int test_fail(const char* fmt, ...) { diff --git a/test/test_malloc.c b/test/test_malloc.c index 9b430fe..202db30 100644 --- a/test/test_malloc.c +++ b/test/test_malloc.c @@ -16,16 +16,13 @@ #define _GNU_SOURCE +#include "test_malloc.h" + #include #include #include #include -#include -#include - -#include "test_malloc.h" - static void* (*test_malloc_sys_malloc)(size_t size) = NULL; static size_t test_malloc_n_allocs = 0; diff --git a/test/tree_bench.c b/test/tree_bench.c index 58535e4..df7d703 100644 --- a/test/tree_bench.c +++ b/test/tree_bench.c @@ -16,16 +16,16 @@ #include "bench.h" +#include "zix/zix.h" + +#include + #include #include #include #include #include -#include - -#include "zix/zix.h" - // #define BENCH_SORTED_ARRAY 1 // Return a pseudo-pseudo-pseudo-random-ish integer with no duplicates diff --git a/test/tree_test.c b/test/tree_test.c index 29fba58..a32a58f 100644 --- a/test/tree_test.c +++ b/test/tree_test.c @@ -14,7 +14,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include "zix/tree.h" + +#include "zix/common.h" + +#include #include #include #include @@ -26,8 +30,6 @@ # include #endif -#include "zix/zix.h" - static unsigned seed = 1; static int diff --git a/test/trie_test.c b/test/trie_test.c index 42bf5dc..4ea6d0d 100644 --- a/test/trie_test.c +++ b/test/trie_test.c @@ -14,12 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "zix/trie.h" + #include #include #include -#include "zix/trie.h" - static const char* strings[] = { "http://example.org/foo", "http://example.org/bar", -- cgit v1.2.1