line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::Driver::SharedMem::t::CHIDriverTests; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11334
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
69
|
|
4
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
57
|
|
5
|
2
|
|
|
2
|
|
1028
|
use CHI::Test; |
|
2
|
|
|
|
|
319575
|
|
|
2
|
|
|
|
|
15
|
|
6
|
2
|
|
|
2
|
|
41705
|
use base qw(CHI::t::Driver); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1475
|
|
7
|
2
|
|
|
2
|
|
151462
|
use Test::Warn; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
270
|
|
8
|
2
|
|
|
2
|
|
17
|
use IPC::SysV; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
103
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use CHI::Test::Util |
11
|
2
|
|
|
2
|
|
13
|
qw(activate_test_logger cmp_bool is_between random_string skip_until); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
484
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
CHI::Driver::SharedMem::t::CHIDriverTests |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Version 0.16 |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.16'; |
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
|
44004
|
return 'CHI::Driver::SharedMem'; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 new_cache_options |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
sub new_cache_options { |
47
|
86
|
|
|
86
|
1
|
135504
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
return ( |
50
|
86
|
|
|
|
|
318
|
$self->SUPER::new_cache_options(), |
51
|
|
|
|
|
|
|
driver => '+CHI::Driver::SharedMem', |
52
|
|
|
|
|
|
|
size => $main::size, |
53
|
|
|
|
|
|
|
shmkey => $main::shmkey, |
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
|
727
|
my $cache; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
3
|
eval { |
67
|
1
|
|
|
|
|
7
|
$cache = CHI->new(driver => 'SharedMem'); |
68
|
|
|
|
|
|
|
}; |
69
|
1
|
50
|
|
|
|
52
|
if($@) { |
70
|
1
|
|
|
|
|
10
|
ok($@ =~ /CHI::Driver::SharedMem - no key given/); |
71
|
1
|
|
|
|
|
396
|
ok(!defined($cache)); |
72
|
|
|
|
|
|
|
} else { |
73
|
0
|
|
|
|
|
0
|
ok(0, 'Allowed shmkey to be undefined'); |
74
|
|
|
|
|
|
|
} |
75
|
2
|
|
|
2
|
|
15
|
} |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
9
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |