lib/VSGDR/UnitTest/TestSet/Test/TestCondition/Checksum.pm

filter: Statementstmt 52.4% 32 / 61 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 8 / 12 Podpod 0.0% 0 / 3 totaltotal 45.9% 40 / 87 SCAR 22.0
CC
5
Cov
46%
_init
20.0
check
6.0
testConditionType
2.0
CRAP 9.0
« lib/VSGDR/UnitTest/TestSet/Test/TestCondition/ExpectedSchema.pm ↑ Summary lib/VSGDR/UnitTest/TestSet/Test/TestCondition/ExecutionTime.pm »
1 package VSGDR::UnitTest::TestSet::Test::TestCondition::Checksum;
2  
3 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 #our \$VERSION = '1.01';
9  
10 1 ▶use parent qw(VSGDR::UnitTest::TestSet::Test::TestCondition) ;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 BEGIN {
12 1 ▶*AUTOLOAD = \&VSGDR::UnitTest::TestSet::Test::TestCondition::AUTOLOAD ;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 }
14  
15 1 ▶use Data::Dumper ;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use Carp ;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 1 ▶use vars qw($AUTOLOAD %ok_field);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # Authorize constructor hash fields
22 1 my %ok_params = () ;
23 1 for my $attr ( qw(CONDITIONTESTACTIONNAME CONDITIONNAME CONDITIONENABLED CONDITIONCHECKSUM) ) { $ok_params{$attr}++; }
24 1 my %ok_fields = () ;
25 1 my %ok_fields_type = () ;
26 # Authorize attribute fields
27 1 for my $attr ( qw(conditionTestActionName conditionName conditionEnabled conditionChecksum) ) { $ok_fields{$attr}++; $ok_fields_type{$attr} = 'plain'; }
28 1 $ok_fields_type{conditionName} = 'quoted';
29 1 $ok_fields_type{conditionEnabled} = 'bool';
30  
31  
32 sub _init {
33  
34 0 ▶ local $_ = undef ;
Subroutine _init: not called CC=4 SCAR=30.0
35  
36 0 my $self = shift ;
37 0 ▶ my $class = ref($self) || $self ;
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
38 0 ▶ my $ref = shift or croak "no arg";
Branch: 1 branch
BranchTrueFalseTotal
my $ref = shift() or croak("no arg") 0 0 0
39  
40 0 $self->{OK_PARAMS} = \%ok_params ;
41 0 $self->{OK_FIELDS} = \%ok_fields ;
42 0 $self->{OK_FIELDS_TYPE} = \%ok_fields_type ;
43 0 my @validargs = grep { exists($$ref{$_}) } keys %{$self->{OK_PARAMS}} ;
44 0 ▶ croak "bad args"
Branch: 1 branch
BranchTrueFalseTotal
if scalar @validargs != 4 0 0 0
45 if scalar(@validargs) != 4 ;
46  
47 0 my ${Name} = $$ref{CONDITIONNAME};
48 0 my ${TestActionName} = $$ref{CONDITIONTESTACTIONNAME};
49 0 my ${Enabled} = $$ref{CONDITIONENABLED};
50 0 my ${Checksum} = $$ref{CONDITIONCHECKSUM};
51  
52  
53 0 $self->conditionName(${Name}) ;
54 0 $self->conditionTestActionName(${TestActionName}) ;
55 0 $self->conditionEnabled(${Enabled}) ;
56 0 $self->conditionChecksum(${Checksum}) ;
57  
58
59 0 return ;
60
61 }
62  
63 sub testConditionType {
64 0 ▶ my $self = shift;
Subroutine testConditionType: not called CC=1 SCAR=6.9
Pod undocumented
65 0 return 'Checksum' ;
66 }
67  
68 sub testConditionMSType {
69 0 ▶ return 'ChecksumCondition' ;
Subroutine testConditionMSType: not called CC=1 SCAR=6.9
Pod undocumented
70 }
71  
72 sub check {
73 0 ▶ local $_ = undef ;
Subroutine check: not called CC=2 SCAR=17.9
Pod undocumented
74 0 my $self = shift ;
75 0 my $ra_res = shift ;
76  
77 #warn Dumper $ra_res ;
78  
79 0 ▶ if ( $self->conditionISEnabled() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->conditionISEnabled) { } 0 0 0
80 0 return scalar 1 ;
81 }
82 else {
83 0 return scalar -1 ;
84 }
85 }
86  
87 1 1 ;
88  
89 __DATA__
« lib/VSGDR/UnitTest/TestSet/Test/TestCondition/ExpectedSchema.pm ↑ Summary lib/VSGDR/UnitTest/TestSet/Test/TestCondition/ExecutionTime.pm »