test-lib: enable MALLOC_* for the actual tests
authorThomas Rast <trast@inf.ethz.ch>
Mon, 17 Jun 2013 09:18:46 +0000 (11:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jun 2013 20:28:45 +0000 (13:28 -0700)
1b3185f (MALLOC_CHECK: various clean-ups, 2012-09-14) moved around the
MALLOC_CHECK_ and MALLOC_PERTURB_ assignments, intending to limit
their effect to only the test runs. However, they were actually
enabled only during test cleanup. Call setup/teardown_malloc_check
also around the evaluation of the actual test snippet.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh
index ca6bdef63d2ee9389729e5118f22461c887dc5ed..229f5f7ff1491ad5d98d9a35a6fe87fd77007296 100644 (file)
@@ -337,8 +337,10 @@ test_eval_ () {
 test_run_ () {
        test_cleanup=:
        expecting_failure=$2
+       setup_malloc_check
        test_eval_ "$1"
        eval_ret=$?
+       teardown_malloc_check
 
        if test -z "$immediate" || test $eval_ret = 0 || test -n "$expecting_failure"
        then