X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/28de1ff76a78ba4d87ea61d5d9fce01c6d035a18..7ff57cdfff5d7b558c581e588fbf9c70a4e39e35:/testsuite/xbt/heap_bench.c diff --git a/testsuite/xbt/heap_bench.c b/testsuite/xbt/heap_bench.c index ca64029dc3..a18402bf46 100644 --- a/testsuite/xbt/heap_bench.c +++ b/testsuite/xbt/heap_bench.c @@ -13,6 +13,7 @@ #include #include +#include #include "xbt/heap.h" #include "gras/virtu.h" /* time manipulation in bench */ @@ -47,12 +48,13 @@ int compare_double(const void *a, const void *b) void test_heap_validity(int size) { xbt_heap_t heap = xbt_heap_new(size, NULL); - double *tab = calloc(size, sizeof(double)); + double *tab = (double*)calloc(size,sizeof(double)); + int i; for (i = 0; i < size; i++) { - tab[i] = (10.0 * rand() / (RAND_MAX + 1.0)); - xbt_heap_push(heap, NULL, tab[i]); + tab[i] = (double)(10.0 * rand() / (RAND_MAX + 1.0)); + xbt_heap_push(heap, NULL, (double)tab[i]); } qsort(tab, size, sizeof(double), compare_double); @@ -80,6 +82,7 @@ void test_heap_mean_operation(int size) date = gras_os_time() * 1000000; for (i = 0; i < size; i++) xbt_heap_push(heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0))); + date = gras_os_time() * 1000000 - date; printf("Creation time %d size heap : %g\n", size, date);