X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/59754cd381aabf278305badcfefbe45cd934ef6c..989c5649c26e6d8bcba9d5467b2d752643f7beed:/teshsuite/xbt/heap_bench/heap_bench.c diff --git a/teshsuite/xbt/heap_bench/heap_bench.c b/teshsuite/xbt/heap_bench/heap_bench.c index ce3d7fc0e9..cff04fe087 100644 --- a/teshsuite/xbt/heap_bench/heap_bench.c +++ b/teshsuite/xbt/heap_bench/heap_bench.c @@ -26,6 +26,16 @@ static int compare_double(const void *a, const void *b) return -1; } +static void test_reset_heap(xbt_heap_t * heap, int size) +{ + xbt_heap_free(*heap); + *heap = xbt_heap_new(size, NULL); + + for (int i = 0; i < size; i++) { + xbt_heap_push(*heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0))); + } +} + static void test_heap_validity(int size) { xbt_heap_t heap = xbt_heap_new(size, NULL); @@ -79,16 +89,6 @@ static void test_heap_mean_operation(int size) xbt_heap_free(heap); } -static void test_reset_heap(xbt_heap_t * heap, int size) -{ - xbt_heap_free(*heap); - *heap = xbt_heap_new(size, NULL); - - for (int i = 0; i < size; i++) { - xbt_heap_push(*heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0))); - } -} - int main(int argc, char **argv) { int size;