1 package Test::Valgrind::Test::Action;
6 use base qw/Test::Valgrind::Action::Test/;
12 require Test::Valgrind;
14 XSLoader::load('Test::Valgrind', $Test::Valgrind::VERSION);
20 *report = *report_smart;
26 sub new { shift->SUPER::new(extra_tests => $extra_tests) }
29 my ($self, $sess, $report) = @_;
31 if ($report->can('is_leak') and $report->is_leak) {
32 my $tb = Test::Builder->new;
33 my $data = $report->data;
34 $tb->is_eq($data->{leakedbytes}, 10_000, '10_000 bytes leaked');
35 $tb->is_eq($data->{leakedblocks}, 1, ' in one block');
36 $tb->diag("The subsequent report was correctly caught:\n" . $report->dump)
37 if ($data->{leakedbytes} || 0) == 10_000
38 and ($data->{leakedblocks} || 0) == 1;
42 $self->SUPER::report($sess, $report);