diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2021-10-26 01:55:33 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2021-10-26 01:55:33 -0600 |
commit | 2c94d5baaec9e65550df942cf976db48bd36d9b5 (patch) | |
tree | 6eb68deb9ab93d53539ef3cab283991140ddf0e6 /tests | |
parent | 969c054e5b1aee7fb034667f09240216ea0c6abf (diff) | |
download | stm32l4-2c94d5baaec9e65550df942cf976db48bd36d9b5.tar.gz stm32l4-2c94d5baaec9e65550df942cf976db48bd36d9b5.tar.bz2 stm32l4-2c94d5baaec9e65550df942cf976db48bd36d9b5.zip |
run clang-format.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_array_list.c | 6 | ||||
-rw-r--r-- | tests/test_avl_tree.c | 6 | ||||
-rw-r--r-- | tests/test_linked_list.c | 5 | ||||
-rw-r--r-- | tests/test_map.c | 9 | ||||
-rw-r--r-- | tests/test_memory.c | 12 | ||||
-rw-r--r-- | tests/test_mpu.c | 7 |
6 files changed, 18 insertions, 27 deletions
diff --git a/tests/test_array_list.c b/tests/test_array_list.c index 71ffa55..86ef27d 100644 --- a/tests/test_array_list.c +++ b/tests/test_array_list.c @@ -51,9 +51,10 @@ TEST(array_list, foreach) int i = 0; int values[3]; - array_list_foreach(arl, val) { + array_list_foreach(arl, val) + { values[i] = val; - ++ i; + ++i; } ASSERT_EQ(values[0], 3); @@ -61,5 +62,4 @@ TEST(array_list, foreach) ASSERT_EQ(values[2], 1); return 0; - } diff --git a/tests/test_avl_tree.c b/tests/test_avl_tree.c index 2a7260f..dd14917 100644 --- a/tests/test_avl_tree.c +++ b/tests/test_avl_tree.c @@ -125,7 +125,7 @@ TEST(avl_tree, find) { avl_tree_t(int)* tree = avl_tree_new(int)(); - for (int i = 0; i < 16; ++ i) { + for (int i = 0; i < 16; ++i) { avl_tree_insert(int)(tree, i); } @@ -138,10 +138,10 @@ TEST(avl_tree, find) return 0; } -TEST (avl_tree, stress) +TEST(avl_tree, stress) { avl_tree_t(int)* tree = avl_tree_new(int)(); - for (int i = 0; i < 512; ++ i) { + for (int i = 0; i < 512; ++i) { avl_tree_insert(int)(tree, i); } diff --git a/tests/test_linked_list.c b/tests/test_linked_list.c index 2c51625..3b665f3 100644 --- a/tests/test_linked_list.c +++ b/tests/test_linked_list.c @@ -49,9 +49,10 @@ TEST(linked_list, foreach) int i = 0; int values[3]; - linked_list_foreach(ll, val) { + linked_list_foreach(ll, val) + { values[i] = val; - ++ i; + ++i; } ASSERT_EQ(values[0], 1); diff --git a/tests/test_map.c b/tests/test_map.c index 29704f0..db0fd9a 100644 --- a/tests/test_map.c +++ b/tests/test_map.c @@ -34,8 +34,8 @@ MAP_DECL(int, int_ptr); MAP_IMPL(int, int_ptr, integer_cmp_, kfree); static inline void loose_map_print( - avl_tree_node_t(map_entry_t(int, int_ptr))* node, - int tab) { + avl_tree_node_t(map_entry_t(int, int_ptr)) * node, int tab) +{ if (node) { loose_map_print(node->right, tab + 1); } @@ -49,8 +49,7 @@ static inline void loose_map_print( printf("(%d => %d)\n", node->value.key, *node->value.value); loose_map_print(node->left, tab + 1); } -static inline void map_debug_print( - map_t(int, int_ptr) * map) +static inline void map_debug_print(map_t(int, int_ptr) * map) { printf("------\n"); if (map->tree) { @@ -96,7 +95,7 @@ TEST(map, stress) erased[e] = 1; } - for (int i = 0; i < N; ++ i) { + for (int i = 0; i < N; ++i) { if (erased[i]) { continue; } diff --git a/tests/test_memory.c b/tests/test_memory.c index c85e228..407aa3d 100644 --- a/tests/test_memory.c +++ b/tests/test_memory.c @@ -262,11 +262,7 @@ TEST(memory, alloc1) kalloc(1); if (debug_kalloc_assert_consistency(buf, 1024)) { - fprintf( - stderr, - "Consistency check failed. (%s:%d)\n", - __FILE__, - __LINE__); + fprintf(stderr, "Consistency check failed. (%s:%d)\n", __FILE__, __LINE__); fprintf(stderr, "%s", buf); ASSERT_TRUE(false); } @@ -282,11 +278,7 @@ TEST(memory, alloc0) kalloc(0); if (debug_kalloc_assert_consistency(buf, 1024)) { - fprintf( - stderr, - "Consistency check failed. (%s:%d)\n", - __FILE__, - __LINE__); + fprintf(stderr, "Consistency check failed. (%s:%d)\n", __FILE__, __LINE__); fprintf(stderr, "%s", buf); ASSERT_TRUE(false); } diff --git a/tests/test_mpu.c b/tests/test_mpu.c index 551e079..9ffaa5d 100644 --- a/tests/test_mpu.c +++ b/tests/test_mpu.c @@ -1,12 +1,11 @@ -#include "test_harness.c" - #include "arch/arm/cortex-m4/mpu.h" #include "kern/mpu/mpu_manager.h" +#include "test_harness.c" TEST(mpu, smell) { - memory_region_opts_t memopts = { 0 }; - memopts.region = (void*) 0; + memory_region_opts_t memopts = {0}; + memopts.region = (void*)0; memopts.bufferable = 0; memopts.cacheable = 1; memopts.sharable = 1; |