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