From: Martin Quinson Date: Mon, 8 Oct 2012 23:01:16 +0000 (+0200) Subject: checks that double free are correctly detected X-Git-Tag: v3_8~99^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7acc91049c2aebd1842988676f6ccdf2a54e3b45 checks that double free are correctly detected --- diff --git a/teshsuite/xbt/mmalloc_test.c b/teshsuite/xbt/mmalloc_test.c index 30e09949c1..dc1e6d9e30 100644 --- a/teshsuite/xbt/mmalloc_test.c +++ b/teshsuite/xbt/mmalloc_test.c @@ -37,7 +37,18 @@ int main(int argc, char**argv) } for (i = 0; i < TESTSIZE; i++) { + xbt_ex_t e; + int gotit = 1; + mfree(heapA, pointers[i]); + TRY { + mfree(heapA, pointers[i]); + gotit = 0; + } CATCH(e) { + xbt_ex_free(e); + } + if (!gotit) + xbt_die("FAIL: A double-free went undetected (for size:%d)",((i%10)+1)*100); } XBT_INFO("Done; bye bye");