line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
14
|
|
|
14
|
|
563872
|
use 5.006; |
|
14
|
|
|
|
|
39
|
|
|
14
|
|
|
|
|
475
|
|
2
|
14
|
|
|
14
|
|
96
|
use strict; |
|
14
|
|
|
|
|
36
|
|
|
14
|
|
|
|
|
379
|
|
3
|
14
|
|
|
14
|
|
62
|
use warnings; |
|
14
|
|
|
|
|
18
|
|
|
14
|
|
|
|
|
479
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Net::LDAP::Mixin; |
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
3831
|
use Net::LDAP; |
|
14
|
|
|
|
|
591899
|
|
|
14
|
|
|
|
|
85
|
|
8
|
14
|
|
|
14
|
|
946
|
use Net::LDAP::Constant; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
319
|
|
9
|
14
|
|
|
14
|
|
132
|
use Test::Builder; |
|
14
|
|
|
|
|
17
|
|
|
14
|
|
|
|
|
231
|
|
10
|
14
|
|
|
14
|
|
5311
|
use Test::Net::LDAP::Util; |
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
797
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
for my $method (qw(search compare add modify delete moddn bind unbind abandon)) { |
13
|
14
|
|
|
14
|
|
74
|
no strict 'refs'; |
|
14
|
|
|
|
|
21
|
|
|
14
|
|
|
|
|
5058
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$method.'_ok'} = sub { |
16
|
105
|
|
|
105
|
|
31768
|
my $self = shift; |
17
|
105
|
|
|
|
|
159
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
18
|
105
|
|
|
|
|
285
|
return $self->method_ok($method, @_); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$method.'_is'} = sub { |
22
|
44
|
|
|
44
|
|
6454
|
my $self = shift; |
23
|
44
|
|
|
|
|
60
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
24
|
44
|
|
|
|
|
84
|
return $self->method_is($method, @_); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub method_ok { |
29
|
108
|
|
|
108
|
0
|
1565
|
my $ldap = shift; |
30
|
108
|
|
|
|
|
112
|
my $method = shift; |
31
|
108
|
|
|
|
|
99
|
my ($params, $name); |
32
|
|
|
|
|
|
|
|
33
|
108
|
100
|
|
|
|
228
|
if (ref $_[0] eq 'ARRAY') { |
34
|
5
|
|
|
|
|
8
|
($params, $name) = @_; |
35
|
|
|
|
|
|
|
} else { |
36
|
103
|
|
|
|
|
156
|
$params = \@_; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
108
|
|
|
|
|
133
|
my $expected = Net::LDAP::Constant::LDAP_SUCCESS; |
40
|
108
|
|
|
|
|
243
|
return $ldap->method_is($method, $params, $expected, $name); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub method_is { |
44
|
153
|
|
|
153
|
0
|
585
|
my $ldap = shift; |
45
|
153
|
|
|
|
|
144
|
my $method = shift; |
46
|
153
|
|
|
|
|
129
|
my ($params, $expected, $name); |
47
|
|
|
|
|
|
|
|
48
|
153
|
50
|
|
|
|
297
|
if (ref $_[0] eq 'ARRAY') { |
49
|
153
|
|
|
|
|
300
|
($params, $expected, $name) = @_; |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
0
|
$params = \@_; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
153
|
|
|
|
|
536
|
my $mesg = $ldap->$method(@$params); |
55
|
|
|
|
|
|
|
|
56
|
153
|
50
|
|
|
|
860
|
unless (defined $name) { |
57
|
153
|
|
|
|
|
331
|
my $arg = Net::LDAP::_dn_options(@$params); |
58
|
|
|
|
|
|
|
|
59
|
211
|
|
|
|
|
360
|
$name = $method.'('.join(', ', map { |
60
|
918
|
|
|
|
|
1114
|
my ($param, $value) = ($_, "$arg->{$_}"); |
61
|
211
|
100
|
|
|
|
373
|
$value = substr($value, 0, 32).'...' if length($value) > 32; |
62
|
211
|
|
|
|
|
579
|
qq($param => "$value"); |
63
|
|
|
|
|
|
|
} grep { |
64
|
153
|
|
|
|
|
2032
|
defined $arg->{$_} |
65
|
|
|
|
|
|
|
} qw(base scope filter dn newrdn newsuperior)).')'; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
153
|
|
|
|
|
210
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
69
|
153
|
|
|
|
|
376
|
Test::Net::LDAP::Util::ldap_result_is($mesg, $expected, $name); |
70
|
|
|
|
|
|
|
|
71
|
153
|
|
|
|
|
1044
|
return $mesg; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |