[flac-dev] [PATCH 3/3] export MALLOC_PERTURB_ and MALLOC_CHECK_ in test suite

Erik de Castro Lopo mle+la at mega-nerd.com
Wed Apr 18 05:08:52 PDT 2012


Cristian Rodríguez wrote:

> That enables an special implementation that checks
> for common memory errors and will save us from a lot pain.
> ---
>  test/test_bins.sh      |    2 ++
>  test/test_flac.sh      |    2 ++
>  test/test_grabbag.sh   |    2 ++
>  test/test_libFLAC++.sh |    2 ++
>  test/test_libFLAC.sh   |    3 +++
>  test/test_metaflac.sh  |    2 ++
>  test/test_seeking.sh   |    2 ++
>  test/test_streams.sh   |    2 ++
>  8 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/test/test_bins.sh b/test/test_bins.sh
> index 55a0b8a..9b1fa0f 100755
> --- a/test/test_bins.sh
> +++ b/test/test_bins.sh
> @@ -37,6 +37,8 @@ LD_LIBRARY_PATH=../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
>  LD_LIBRARY_PATH=../src/share/utf8/.libs:$LD_LIBRARY_PATH
>  LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
>  export LD_LIBRARY_PATH
> +export MALLOC_CHECK_=3
> +export MALLOC_PERTURB_==$(($RANDOM % 255 + 1))

This has problems.

This fails in bash, sh and dash. Eg bash:

    $ echo $(($RANDON % 256))
    bash: % 256: syntax error: operand expected (error token is "% 256")

I do howver like this idea it if can be made to work

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the flac-dev mailing list