line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::Driver::SharedMem::t::CHIDriverTests; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10545
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
70
|
|
4
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
66
|
|
5
|
2
|
|
|
2
|
|
1015
|
use CHI::Test; |
|
2
|
|
|
|
|
314403
|
|
|
2
|
|
|
|
|
16
|
|
6
|
2
|
|
|
2
|
|
40572
|
use base qw(CHI::t::Driver); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
1658
|
|
7
|
2
|
|
|
2
|
|
153345
|
use Test::Warn; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
168
|
|
8
|
2
|
|
|
2
|
|
18
|
use IPC::SysV; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
116
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use CHI::Test::Util |
11
|
2
|
|
|
2
|
|
16
|
qw(activate_test_logger cmp_bool is_between random_string skip_until); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
508
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
CHI::Driver::SharedMem::t::CHIDriverTests |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Version 0.18 |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.18'; |
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
|
43501
|
return 'CHI::Driver::SharedMem'; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 new_cache_options |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
sub new_cache_options { |
47
|
86
|
|
|
86
|
1
|
140485
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
return ( |
50
|
86
|
|
|
|
|
326
|
$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
|
695
|
my $cache; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
3
|
eval { |
67
|
1
|
|
|
|
|
7
|
$cache = CHI->new(driver => 'SharedMem'); |
68
|
|
|
|
|
|
|
}; |
69
|
1
|
50
|
|
|
|
43
|
if($@) { |
70
|
1
|
|
|
|
|
12
|
ok($@ =~ /CHI::Driver::SharedMem - no key given/); |
71
|
1
|
|
|
|
|
512
|
ok(!defined($cache)); |
72
|
|
|
|
|
|
|
} else { |
73
|
0
|
|
|
|
|
0
|
ok(0, 'Allowed shm_key to be undefined'); |
74
|
|
|
|
|
|
|
} |
75
|
2
|
|
|
2
|
|
19
|
} |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
16
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |