line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VSGDR::UnitTest::TestSet::Test::TestCondition::EmptyResultSet; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
997
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#our \$VERSION = '1.01'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use parent qw(VSGDR::UnitTest::TestSet::Test::TestCondition) ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
|
1
|
|
88
|
*AUTOLOAD = \&VSGDR::UnitTest::TestSet::Test::TestCondition::AUTOLOAD ; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
5
|
use Data::Dumper ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
16
|
1
|
|
|
1
|
|
5
|
use Carp ; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
54
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
6
|
use vars qw($AUTOLOAD %ok_field); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
484
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Authorize constructor hash fields |
24
|
|
|
|
|
|
|
my %ok_params = () ; |
25
|
|
|
|
|
|
|
for my $attr ( qw( CONDITIONTESTACTIONNAME CONDITIONNAME CONDITIONENABLED CONDITIONRESULTSET) ) { $ok_params{$attr}++; } |
26
|
|
|
|
|
|
|
my %ok_fields = () ; |
27
|
|
|
|
|
|
|
my %ok_fields_type = () ; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Authorize attribute fields |
30
|
|
|
|
|
|
|
for my $attr ( qw(conditionTestActionName conditionName conditionEnabled conditionResultSet) ) { $ok_fields{$attr}++; $ok_fields_type{$attr} = 'plain'; } |
31
|
|
|
|
|
|
|
$ok_fields_type{conditionName} = 'quoted'; |
32
|
|
|
|
|
|
|
$ok_fields_type{conditionEnabled} = 'bool'; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _init { |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
|
|
local $_ = undef ; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $self = shift ; |
39
|
0
|
|
0
|
|
|
|
my $class = ref($self) || $self ; |
40
|
0
|
0
|
|
|
|
|
my $ref = shift or croak "no arg"; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$self->{OK_PARAMS} = \%ok_params ; |
43
|
0
|
|
|
|
|
|
$self->{OK_FIELDS} = \%ok_fields ; |
44
|
0
|
|
|
|
|
|
$self->{OK_FIELDS_TYPE} = \%ok_fields_type ; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my @validargs = grep { exists($$ref{$_}) } keys %{$self->{OK_PARAMS}} ; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
croak "bad args" |
48
|
|
|
|
|
|
|
if scalar(@validargs) != 4 ; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my ${Name} = $$ref{CONDITIONNAME}; |
51
|
0
|
|
|
|
|
|
my ${TestActionName} = $$ref{CONDITIONTESTACTIONNAME}; |
52
|
0
|
|
|
|
|
|
my ${Enabled} = $$ref{CONDITIONENABLED}; |
53
|
0
|
|
|
|
|
|
my ${ResultSet} = $$ref{CONDITIONRESULTSET}; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$self->conditionName(${Name}) ; |
56
|
0
|
|
|
|
|
|
$self->conditionTestActionName(${TestActionName}) ; |
57
|
0
|
|
|
|
|
|
$self->conditionEnabled(${Enabled}) ; |
58
|
0
|
|
|
|
|
|
$self->conditionResultSet(${ResultSet}) ; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return ; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub testConditionType { |
65
|
0
|
|
|
0
|
0
|
|
return 'EmptyResultSet' ; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub testConditionMSType { |
69
|
0
|
|
|
0
|
0
|
|
return 'EmptyResultSetCondition' ; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub check { |
73
|
0
|
|
|
0
|
0
|
|
local $_ = undef ; |
74
|
0
|
|
|
|
|
|
my $self = shift ; |
75
|
0
|
|
|
|
|
|
my $ra_res = shift ; |
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
|
if ( $self->conditionISEnabled() ) { |
78
|
0
|
0
|
|
|
|
|
if ( scalar(@{$ra_res->[$self->conditionResultSet()-1]})){ |
|
0
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
say 'Condition is ', $self->conditionName() ; |
80
|
0
|
|
|
|
|
|
say 'value is ', '"'.scalar(@{$ra_res->[$self->conditionResultSet()-1]}).'"' ; |
|
0
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
say 'expected was ', '"0"' ; |
82
|
0
|
|
|
|
|
|
return scalar 0 ; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
else { |
85
|
0
|
|
|
|
|
|
return scalar 1 ; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
else { |
89
|
0
|
|
|
|
|
|
return scalar -1 ; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1 ; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__DATA__ |