line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
14
|
|
|
14
|
|
692762
|
use 5.006; |
|
14
|
|
|
|
|
38
|
|
|
14
|
|
|
|
|
467
|
|
2
|
14
|
|
|
14
|
|
81
|
use strict; |
|
14
|
|
|
|
|
34
|
|
|
14
|
|
|
|
|
374
|
|
3
|
14
|
|
|
14
|
|
63
|
use warnings; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
832
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Net::LDAP::Mixin; |
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
4135
|
use Net::LDAP; |
|
14
|
|
|
|
|
662192
|
|
|
14
|
|
|
|
|
89
|
|
8
|
14
|
|
|
14
|
|
977
|
use Net::LDAP::Constant; |
|
14
|
|
|
|
|
19
|
|
|
14
|
|
|
|
|
344
|
|
9
|
14
|
|
|
14
|
|
127
|
use Test::Builder; |
|
14
|
|
|
|
|
18
|
|
|
14
|
|
|
|
|
249
|
|
10
|
14
|
|
|
14
|
|
5223
|
use Test::Net::LDAP::Util; |
|
14
|
|
|
|
|
23
|
|
|
14
|
|
|
|
|
793
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
for my $method (qw(search compare add modify delete moddn bind unbind abandon)) { |
13
|
14
|
|
|
14
|
|
91
|
no strict 'refs'; |
|
14
|
|
|
|
|
15
|
|
|
14
|
|
|
|
|
4978
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$method.'_ok'} = sub { |
16
|
102
|
|
|
102
|
|
30094
|
my $self = shift; |
17
|
102
|
|
|
|
|
161
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
18
|
102
|
|
|
|
|
506
|
return $self->method_ok($method, @_); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$method.'_is'} = sub { |
22
|
44
|
|
|
44
|
|
6945
|
my $self = shift; |
23
|
44
|
|
|
|
|
64
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
24
|
44
|
|
|
|
|
84
|
return $self->method_is($method, @_); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub method_ok { |
29
|
105
|
|
|
105
|
0
|
962
|
my $ldap = shift; |
30
|
105
|
|
|
|
|
121
|
my $method = shift; |
31
|
105
|
|
|
|
|
97
|
my ($params, $name); |
32
|
|
|
|
|
|
|
|
33
|
105
|
100
|
|
|
|
221
|
if (ref $_[0] eq 'ARRAY') { |
34
|
5
|
|
|
|
|
10
|
($params, $name) = @_; |
35
|
|
|
|
|
|
|
} else { |
36
|
100
|
|
|
|
|
185
|
$params = \@_; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
105
|
|
|
|
|
140
|
my $expected = Net::LDAP::Constant::LDAP_SUCCESS; |
40
|
105
|
|
|
|
|
277
|
return $ldap->method_is($method, $params, $expected, $name); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub method_is { |
44
|
150
|
|
|
150
|
0
|
479
|
my $ldap = shift; |
45
|
150
|
|
|
|
|
144
|
my $method = shift; |
46
|
150
|
|
|
|
|
136
|
my ($params, $expected, $name); |
47
|
|
|
|
|
|
|
|
48
|
150
|
50
|
|
|
|
302
|
if (ref $_[0] eq 'ARRAY') { |
49
|
150
|
|
|
|
|
290
|
($params, $expected, $name) = @_; |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
0
|
$params = \@_; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
150
|
|
|
|
|
537
|
my $mesg = $ldap->$method(@$params); |
55
|
|
|
|
|
|
|
|
56
|
150
|
50
|
|
|
|
886
|
unless (defined $name) { |
57
|
150
|
|
|
|
|
370
|
my $arg = Net::LDAP::_dn_options(@$params); |
58
|
|
|
|
|
|
|
|
59
|
205
|
|
|
|
|
320
|
$name = $method.'('.join(', ', map { |
60
|
900
|
|
|
|
|
1252
|
my ($param, $value) = ($_, "$arg->{$_}"); |
61
|
205
|
100
|
|
|
|
386
|
$value = substr($value, 0, 32).'...' if length($value) > 32; |
62
|
205
|
|
|
|
|
631
|
qq($param => "$value"); |
63
|
|
|
|
|
|
|
} grep { |
64
|
150
|
|
|
|
|
2179
|
defined $arg->{$_} |
65
|
|
|
|
|
|
|
} qw(base scope filter dn newrdn newsuperior)).')'; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
150
|
|
|
|
|
231
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
69
|
150
|
|
|
|
|
448
|
Test::Net::LDAP::Util::ldap_result_is($mesg, $expected, $name); |
70
|
|
|
|
|
|
|
|
71
|
150
|
|
|
|
|
1056
|
return $mesg; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |