Tree wide: Reformat with clang-format.
[collectd.git] / src / daemon / utils_heap_test.c
index 54a9613..8443b60 100644 (file)
@@ -29,8 +29,7 @@
 #include "testing.h"
 #include "utils_heap.h"
 
-static int compare (void const *v0, void const *v1)
-{
+static int compare(void const *v0, void const *v1) {
   int const *i0 = v0;
   int const *i1 = v1;
 
@@ -42,30 +41,27 @@ static int compare (void const *v0, void const *v1)
     return 0;
 }
 
-DEF_TEST(simple)
-{
-  int values[] = { 9, 5, 6, 1, 3, 4, 0, 8, 2, 7 };
+DEF_TEST(simple) {
+  int values[] = {9, 5, 6, 1, 3, 4, 0, 8, 2, 7};
   c_heap_t *h;
 
-  CHECK_NOT_NULL(h = c_heap_create (compare));
+  CHECK_NOT_NULL(h = c_heap_create(compare));
   for (int i = 0; i < 10; i++)
-    CHECK_ZERO(c_heap_insert (h, &values[i]));
+    CHECK_ZERO(c_heap_insert(h, &values[i]));
 
-  for (int i = 0; i < 5; i++)
-  {
+  for (int i = 0; i < 5; i++) {
     int *ret = NULL;
     CHECK_NOT_NULL(ret = c_heap_get_root(h));
     OK(*ret == i);
   }
 
-  CHECK_ZERO(c_heap_insert (h, &values[6] /* = 0 */));
-  CHECK_ZERO(c_heap_insert (h, &values[3] /* = 1 */));
-  CHECK_ZERO(c_heap_insert (h, &values[8] /* = 2 */));
-  CHECK_ZERO(c_heap_insert (h, &values[4] /* = 3 */));
-  CHECK_ZERO(c_heap_insert (h, &values[5] /* = 4 */));
+  CHECK_ZERO(c_heap_insert(h, &values[6] /* = 0 */));
+  CHECK_ZERO(c_heap_insert(h, &values[3] /* = 1 */));
+  CHECK_ZERO(c_heap_insert(h, &values[8] /* = 2 */));
+  CHECK_ZERO(c_heap_insert(h, &values[4] /* = 3 */));
+  CHECK_ZERO(c_heap_insert(h, &values[5] /* = 4 */));
 
-  for (int i = 0; i < 10; i++)
-  {
+  for (int i = 0; i < 10; i++) {
     int *ret = NULL;
     CHECK_NOT_NULL(ret = c_heap_get_root(h));
     OK(*ret == i);
@@ -75,8 +71,7 @@ DEF_TEST(simple)
   return (0);
 }
 
-int main (void)
-{
+int main(void) {
   RUN_TEST(simple);
 
   END_TEST;