X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_heap_test.c;h=54a9613abecac1bd5da1f2a3f8de9e7d777bb3cd;hb=4979d8dcd6f097eb8fd4661086e28accd31ff905;hp=53d0fba863f3b7cb6a117e5224107d9dc98cfb8c;hpb=b4cc5c7399adf79198aea816d44a42df25431d15;p=collectd.git diff --git a/src/daemon/utils_heap_test.c b/src/daemon/utils_heap_test.c index 53d0fba8..54a9613a 100644 --- a/src/daemon/utils_heap_test.c +++ b/src/daemon/utils_heap_test.c @@ -24,8 +24,9 @@ * Florian octo Forster */ -#include "testing.h" #include "collectd.h" + +#include "testing.h" #include "utils_heap.h" static int compare (void const *v0, void const *v1) @@ -44,14 +45,13 @@ static int compare (void const *v0, void const *v1) DEF_TEST(simple) { int values[] = { 9, 5, 6, 1, 3, 4, 0, 8, 2, 7 }; - int i; c_heap_t *h; CHECK_NOT_NULL(h = c_heap_create (compare)); - for (i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) CHECK_ZERO(c_heap_insert (h, &values[i])); - for (i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) { int *ret = NULL; CHECK_NOT_NULL(ret = c_heap_get_root(h)); @@ -64,7 +64,7 @@ DEF_TEST(simple) CHECK_ZERO(c_heap_insert (h, &values[4] /* = 3 */)); CHECK_ZERO(c_heap_insert (h, &values[5] /* = 4 */)); - for (i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) { int *ret = NULL; CHECK_NOT_NULL(ret = c_heap_get_root(h));