[flac-dev] [PATCH 3/3] export MALLOC_PERTURB_ and MALLOC_CHECK_ in test suite
Cristian Rodríguez
crrodriguez at opensuse.org
Wed Apr 18 06:15:18 PDT 2012
On 18/04/12 09:08, Erik de Castro Lopo wrote:
> 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
works for me in zsh, bash..etc.. there is a typo in the quoted line though.
export MALLOC_PERTURB_==$(($RANDOM % 255 + 1))
must say
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
however is not gonna work with dash.
More information about the flac-dev
mailing list