line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
###################################################################### |
2
|
|
|
|
|
|
|
# $Id: BaseCacheTester.pm,v 1.7 2002/04/07 17:04:46 dclinton Exp $ |
3
|
|
|
|
|
|
|
# Copyright (C) 2001-2003 DeWitt Clinton All Rights Reserved |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Software distributed under the License is distributed on an "AS |
6
|
|
|
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or |
7
|
|
|
|
|
|
|
# implied. See the License for the specific language governing |
8
|
|
|
|
|
|
|
# rights and limitations under the License. |
9
|
|
|
|
|
|
|
###################################################################### |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Cache::BaseCacheTester; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
954
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new |
19
|
|
|
|
|
|
|
{ |
20
|
3
|
|
|
3
|
1
|
419
|
my ( $proto, $base_test_count ) = @_; |
21
|
3
|
|
33
|
|
|
38
|
my $class = ref( $proto ) || $proto; |
22
|
3
|
|
|
|
|
7
|
my $self = {}; |
23
|
3
|
|
|
|
|
8
|
bless ( $self, $class ); |
24
|
|
|
|
|
|
|
|
25
|
3
|
50
|
|
|
|
16
|
$base_test_count = defined $base_test_count ? $base_test_count : 0 ; |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
|
|
32
|
$self->_set_test_count( $base_test_count ); |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
9
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub ok |
34
|
|
|
|
|
|
|
{ |
35
|
79
|
|
|
79
|
1
|
146
|
my ( $self ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
79
|
|
|
|
|
216
|
my $test_count = $self->_get_test_count( ); |
38
|
|
|
|
|
|
|
|
39
|
79
|
|
|
|
|
20813
|
print "ok $test_count\n"; |
40
|
|
|
|
|
|
|
|
41
|
79
|
|
|
|
|
304
|
$self->_increment_test_count( ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub not_ok |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $message ) = @_; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
my $test_count = $self->_get_test_count( ); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
0
|
print "not ok $test_count # failed '$message'\n"; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
0
|
$self->_increment_test_count( ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub skip |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $message ) = @_; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
0
|
my $test_count = $self->_get_test_count( ); |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
0
|
print "ok $test_count # skipped $message \n"; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
0
|
$self->_increment_test_count( ); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub _set_test_count |
70
|
|
|
|
|
|
|
{ |
71
|
3
|
|
|
3
|
|
8
|
my ( $self, $test_count ) = @_; |
72
|
|
|
|
|
|
|
|
73
|
3
|
|
|
|
|
27
|
$self->{_Test_Count} = $test_count; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _get_test_count |
78
|
|
|
|
|
|
|
{ |
79
|
80
|
|
|
80
|
|
142
|
my ( $self ) = @_; |
80
|
|
|
|
|
|
|
|
81
|
80
|
|
|
|
|
509
|
return $self->{_Test_Count}; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub _increment_test_count |
86
|
|
|
|
|
|
|
{ |
87
|
79
|
|
|
79
|
|
140
|
my ( $self ) = @_; |
88
|
|
|
|
|
|
|
|
89
|
79
|
|
|
|
|
563
|
$self->{_Test_Count}++; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |