Check/Test/mx_compare.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 44 CC 4 SCAR 20.1
CC
4
Cov
0%
test
12.0
new
6.0
BEGIN
2.0
CRAP 7.4
1 package Net::DNS::Check::Test::mx_compare;
2  
3 use strict;
4 use vars qw(@ISA $VERSION);
5  
6 @ISA = qw(Net::DNS::Check::Test);
7  
8  
9 sub new {
10 my ($class) = shift;
11  
12 my ($self) = bless {}, $class;
13  
14 if ( @_ ) {
15 $self->_process_args(@_);
16 }
17  
18 $self->test();
19  
20 return $self;
21 }
22  
23  
24  
25 sub test() {
26 my ($self) = shift;
27  
28 # return unless ( $self->{config} );
29  
30 my $test_status = 1;
31 my %compare_hash;
32 my $test_detail = {};
33  
34 foreach my $nsquery ( @{$self->{nsquery}} ) {
35 my @mx_list = sort $nsquery->mx_list();
36 my $ns_name = $nsquery->ns_name();
37 my $mxkey = lc(join('|', @mx_list));
38  
39 if ($mxkey) {
40 $compare_hash{$mxkey}++;
41 }
42  
43 $test_detail->{$ns_name}->{desc} = join(' ', @mx_list);
44 }
45  
46 if ((scalar keys %compare_hash) > 1) {
47 $test_status = 0;
48 }
49  
50 $self->{test_status} = $test_status;
51 $self->{test_detail} = $test_detail;
52  
53 return $test_status;
54 }
55  
56 1;
57  
58 __END__