X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_heap_test.c;h=54a9613abecac1bd5da1f2a3f8de9e7d777bb3cd;hb=5523a080010dcb7a61dc0dccc3969a2a048e52f9;hp=6ef80475c0bde77931173b0d50231561a84934af;hpb=826293bf3acfdcee6632f5d8f0b6be013f2cebab;p=collectd.git diff --git a/src/daemon/utils_heap_test.c b/src/daemon/utils_heap_test.c index 6ef80475..54a9613a 100644 --- a/src/daemon/utils_heap_test.c +++ b/src/daemon/utils_heap_test.c @@ -25,6 +25,7 @@ */ #include "collectd.h" + #include "testing.h" #include "utils_heap.h" @@ -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));