line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::Driver::SharedMem::t::CHIDriverTests; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10707
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
64
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
53
|
|
5
|
2
|
|
|
2
|
|
949
|
use CHI::Test; |
|
2
|
|
|
|
|
309888
|
|
|
2
|
|
|
|
|
26
|
|
6
|
2
|
|
|
2
|
|
41298
|
use base qw(CHI::t::Driver); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
1564
|
|
7
|
2
|
|
|
2
|
|
152187
|
use Test::Warn; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
137
|
|
8
|
2
|
|
|
2
|
|
15
|
use IPC::SysV; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
91
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use CHI::Test::Util |
11
|
2
|
|
|
2
|
|
11
|
qw(activate_test_logger cmp_bool is_between random_string skip_until); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
435
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
CHI::Driver::SharedMem::t::CHIDriverTests |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Version 0.19 |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
CHI::Driver::SharedMem::t::CHIDriverTests - test CHI::Driver::SharedMem |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 testing_driver_class |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Declare the driver being tested |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub testing_driver_class { |
40
|
90
|
|
|
90
|
1
|
42434
|
return 'CHI::Driver::SharedMem'; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 new_cache_options |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
sub new_cache_options { |
47
|
86
|
|
|
86
|
1
|
146234
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
return ( |
50
|
86
|
|
|
|
|
332
|
$self->SUPER::new_cache_options(), |
51
|
|
|
|
|
|
|
driver => '+CHI::Driver::SharedMem', |
52
|
|
|
|
|
|
|
shm_size => $main::shm_size, |
53
|
|
|
|
|
|
|
shm_key => $main::shm_key, |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 test_shmkey_required |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Verify that the shmkey option is mandatory |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub test_shmkey_required : Tests { |
64
|
1
|
|
|
1
|
1
|
851
|
my $cache; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
3
|
eval { |
67
|
1
|
|
|
|
|
5
|
$cache = CHI->new(driver => 'SharedMem'); |
68
|
|
|
|
|
|
|
}; |
69
|
1
|
50
|
|
|
|
70
|
if($@) { |
70
|
1
|
|
|
|
|
14
|
ok($@ =~ /CHI::Driver::SharedMem - no shm_key given/); |
71
|
1
|
|
|
|
|
464
|
ok(!defined($cache)); |
72
|
|
|
|
|
|
|
} else { |
73
|
0
|
|
|
|
|
0
|
ok(0, 'Allowed shm_key to be undefined'); |
74
|
|
|
|
|
|
|
} |
75
|
2
|
|
|
2
|
|
17
|
} |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |