X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f..49b53eb334bc6f19b530603201d00bcc312bfd29:/teshsuite/xbt/mmalloc/mmalloc_test.cpp diff --git a/teshsuite/xbt/mmalloc/mmalloc_test.cpp b/teshsuite/xbt/mmalloc/mmalloc_test.cpp index b610e1f042..1a370eb196 100644 --- a/teshsuite/xbt/mmalloc/mmalloc_test.cpp +++ b/teshsuite/xbt/mmalloc/mmalloc_test.cpp @@ -27,8 +27,7 @@ constexpr int TESTSIZE = 100; static void check_block(const unsigned char* p, unsigned char b, int n) { for (int i = 0; i < n; i++) - if (p[i] != b) - xbt_die("value mismatch: %p[%d] = %#hhx, expected %#hhx", p, i, p[i], b); + xbt_assert(p[i] == b, "value mismatch: %p[%d] = %#hhx, expected %#hhx", p, i, p[i], b); } int main(int argc, char**argv) @@ -80,8 +79,7 @@ int main(int argc, char**argv) } catch (const simgrid::Exception&) { gotit = true; } - if (not gotit) - xbt_die("FAIL: A double-free went undetected (for size:%d)",size_of_block(i)); + xbt_assert(gotit, "FAIL: A double-free went undetected (for size:%d)", size_of_block(i)); } XBT_INFO("free again all blocks (to really check that double free are correctly caught)"); @@ -92,8 +90,7 @@ int main(int argc, char**argv) } catch (const simgrid::Exception&) { gotit = true; } - if (not gotit) - xbt_die("FAIL: A double-free went undetected (for size:%d)",size_of_block(i)); + xbt_assert(gotit, "FAIL: A double-free went undetected (for size:%d)", size_of_block(i)); } XBT_INFO("Let's try different codepaths for mrealloc");