X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dccf1b41e9c7b5a696f01abceaa2779fe65f154f..558e19f535bb0c65b610bc758c8133ded549ca3c:/teshsuite/xbt/mmalloc/mmalloc_test.cpp diff --git a/teshsuite/xbt/mmalloc/mmalloc_test.cpp b/teshsuite/xbt/mmalloc/mmalloc_test.cpp index 43edad418d..759f09e473 100644 --- a/teshsuite/xbt/mmalloc/mmalloc_test.cpp +++ b/teshsuite/xbt/mmalloc/mmalloc_test.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014. The SimGrid Team. +/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,12 +6,12 @@ #include "xbt/mmalloc.h" #include "xbt.h" -#include -#include +#include +#include +#include +#include #include #include -#include -#include #include #include @@ -40,11 +40,12 @@ int main(int argc, char**argv) XBT_INFO("HeapA allocated"); - int i, size; + int i; + int size; for (i = 0; i < TESTSIZE; i++) { size = size_of_block(i); pointers[i] = mmalloc(heapA, size); - XBT_INFO("%d bytes allocated with offset %tx", size, ((char*)pointers[i])-((char*)heapA)); + XBT_INFO("%d bytes allocated with offset %zx", size, (size_t)((char*)pointers[i] - (char*)heapA)); } XBT_INFO("All blocks were correctly allocated. Free every second block"); for (i = 0; i < TESTSIZE; i+=2) { @@ -70,7 +71,7 @@ int main(int argc, char**argv) } catch(xbt_ex& e) { gotit = true; } - if (!gotit) + if (not gotit) xbt_die("FAIL: A double-free went undetected (for size:%d)",size_of_block(i)); } @@ -82,7 +83,7 @@ int main(int argc, char**argv) } catch(xbt_ex& e) { gotit = true; } - if (!gotit) + if (not gotit) xbt_die("FAIL: A double-free went undetected (for size:%d)",size_of_block(i)); }