X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=blobdiff_plain;f=lib%2FTest%2FValgrind.pm;fp=lib%2FTest%2FValgrind.pm;h=1df876c3d10fb8f91d8d28d75e21a84ba5fe37a5;hp=421396f90f71644edc6527debde133ffb3d6f7a0;hb=d77165d74a0a4d3a18143cd63cdb624252058698;hpb=8a3289dfc8449aed2d53e35c52c269009630293e diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index 421396f..1df876c 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -96,7 +96,7 @@ C<< callers => $number >> Specify the maximum stack depth studied when valgrind encounters an error. Raising this number improves granularity. -Ignored if you supply your own custom C, otherwise defaults to C<50>. +Ignored if you supply your own custom C, otherwise defaults to C<24> (the maximum allowed by C). =item * @@ -209,12 +209,14 @@ sub analyse { my $tool = delete $args{tool}; unless ($tool->$instanceof('Test::Valgrind::Tool')) { + my $callers = delete $args{callers} || 24; + $callers = 24 if $callers <= 0; require Test::Valgrind::Tool; local $@; $tool = eval { Test::Valgrind::Tool->new( - tool => $tool || 'memcheck', - callers => delete $args{callers}, + tool => $tool || 'memcheck', + callers => $callers, ); }; unless ($tool) {