From: Vincent Pit Date: Wed, 15 Apr 2009 08:48:50 +0000 (+0200) Subject: Reorder a bit the fake test action X-Git-Tag: v1.02~13 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=commitdiff_plain;h=b6d864328dca14ce16a994f974546a76a7097665 Reorder a bit the fake test action --- diff --git a/t/lib/Test/Valgrind/Test/Action.pm b/t/lib/Test/Valgrind/Test/Action.pm index 0ecee8f..0b40940 100644 --- a/t/lib/Test/Valgrind/Test/Action.pm +++ b/t/lib/Test/Valgrind/Test/Action.pm @@ -29,11 +29,11 @@ sub report_smart { my ($self, $sess, $report) = @_; if ($report->can('is_leak') and $report->is_leak) { - my $trace = join ' ', map { $_->[2] } @{$report->data->{stack} || []}[0 .. 2]; + my $data = $report->data; + my $trace = join ' ', map { $_->[2] } @{$data->{stack} || []}[0 .. 2]; if ($trace eq 'malloc XS_Test__Valgrind_leak Perl_pp_entersub') { my $tb = Test::Builder->new; $tb->diag("The subsequent report was correctly caught:\n" . $report->dump); - my $data = $report->data; $tb->is_eq($data->{leakedbytes}, 10_000, '10_000 bytes leaked'); $tb->is_eq($data->{leakedblocks}, 1, ' in one block'); return;