line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mimic::Library::PlayArray; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use base qw; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
112
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use constant { |
9
|
|
|
|
|
|
|
# Instance variable indices |
10
|
1
|
|
|
|
|
475
|
HISTORY => 0, |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# History fields |
13
|
|
|
|
|
|
|
FETCH_F => 0, |
14
|
|
|
|
|
|
|
FETCHSIZE_F => 1, |
15
|
|
|
|
|
|
|
EXISTS_F => 2, |
16
|
1
|
|
|
1
|
|
5
|
}; |
|
1
|
|
|
|
|
1
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# basic methods |
19
|
|
|
|
|
|
|
sub TIEARRAY { |
20
|
0
|
|
|
0
|
|
|
my ( $class, $history ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#Initialize instance variables. |
23
|
0
|
|
|
|
|
|
my $self = []; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
$self->[HISTORY] = $history; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return bless( $self, $class ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub FETCH { |
31
|
0
|
|
|
0
|
|
|
my ( $self, $index ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return Test::Mimic::Library::play( shift( @{ $self->[HISTORY]->[FETCH_F]->[$index] } ) ); |
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
|
|
sub STORE { |
37
|
|
|
|
|
|
|
# not a read, do nothing |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub FETCHSIZE { |
41
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return shift( @{ $self->[HISTORY]->[FETCHSIZE_F] } ); |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
|
|
sub STORESIZE { |
47
|
|
|
|
|
|
|
# not a read, do nothing |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# other methods |
51
|
0
|
|
|
0
|
|
|
sub DELETE { |
52
|
|
|
|
|
|
|
# not a read, do nothing |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub EXISTS { |
56
|
0
|
|
|
0
|
|
|
my ( $self, $index ) = @_; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return shift( @{ $self->[HISTORY]->[EXISTS_F]->[$index] } ); |
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
#POP, SHIFT, and SPLICE will be inherited from Tie::Array |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#NOTE: We always consider SPLICE to be a read. |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
|
|
sub CLEAR { |
66
|
|
|
|
|
|
|
# not a read, do nothing |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
0
|
|
|
sub PUSH { |
70
|
|
|
|
|
|
|
# not a read, do nothing |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
|
|
sub UNSHIFT { |
74
|
|
|
|
|
|
|
# not a read, do nothing |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# optional methods |
78
|
0
|
|
|
0
|
|
|
sub UNTIE { |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
0
|
|
|
sub DESTROY { |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |