line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
14
|
|
|
14
|
|
552236
|
use 5.006; |
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
392
|
|
2
|
14
|
|
|
14
|
|
81
|
use strict; |
|
14
|
|
|
|
|
34
|
|
|
14
|
|
|
|
|
371
|
|
3
|
14
|
|
|
14
|
|
51
|
use warnings; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
362
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Net::LDAP::Mixin; |
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
3446
|
use Net::LDAP; |
|
14
|
|
|
|
|
570239
|
|
|
14
|
|
|
|
|
69
|
|
8
|
14
|
|
|
14
|
|
806
|
use Net::LDAP::Constant; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
290
|
|
9
|
14
|
|
|
14
|
|
117
|
use Test::Builder; |
|
14
|
|
|
|
|
15
|
|
|
14
|
|
|
|
|
208
|
|
10
|
14
|
|
|
14
|
|
4435
|
use Test::Net::LDAP::Util; |
|
14
|
|
|
|
|
25
|
|
|
14
|
|
|
|
|
625
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
for my $method (qw(search compare add modify delete moddn bind unbind abandon)) { |
13
|
14
|
|
|
14
|
|
59
|
no strict 'refs'; |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
4507
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$method.'_ok'} = sub { |
16
|
107
|
|
|
107
|
|
34377
|
my $self = shift; |
17
|
107
|
|
|
|
|
149
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
18
|
107
|
|
|
|
|
258
|
return $self->method_ok($method, @_); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$method.'_is'} = sub { |
22
|
44
|
|
|
44
|
|
6792
|
my $self = shift; |
23
|
44
|
|
|
|
|
64
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
24
|
44
|
|
|
|
|
90
|
return $self->method_is($method, @_); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub method_ok { |
29
|
110
|
|
|
110
|
0
|
884
|
my $ldap = shift; |
30
|
110
|
|
|
|
|
104
|
my $method = shift; |
31
|
110
|
|
|
|
|
94
|
my ($params, $name); |
32
|
|
|
|
|
|
|
|
33
|
110
|
100
|
|
|
|
212
|
if (ref $_[0] eq 'ARRAY') { |
34
|
5
|
|
|
|
|
10
|
($params, $name) = @_; |
35
|
|
|
|
|
|
|
} else { |
36
|
105
|
|
|
|
|
155
|
$params = \@_; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
110
|
|
|
|
|
122
|
my $expected = Net::LDAP::Constant::LDAP_SUCCESS; |
40
|
110
|
|
|
|
|
222
|
return $ldap->method_is($method, $params, $expected, $name); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub method_is { |
44
|
155
|
|
|
155
|
0
|
429
|
my $ldap = shift; |
45
|
155
|
|
|
|
|
125
|
my $method = shift; |
46
|
155
|
|
|
|
|
109
|
my ($params, $expected, $name); |
47
|
|
|
|
|
|
|
|
48
|
155
|
50
|
|
|
|
271
|
if (ref $_[0] eq 'ARRAY') { |
49
|
155
|
|
|
|
|
256
|
($params, $expected, $name) = @_; |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
0
|
$params = \@_; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
155
|
|
|
|
|
494
|
my $mesg = $ldap->$method(@$params); |
55
|
|
|
|
|
|
|
|
56
|
155
|
50
|
|
|
|
874
|
unless (defined $name) { |
57
|
155
|
|
|
|
|
328
|
my $arg = Net::LDAP::_dn_options(@$params); |
58
|
|
|
|
|
|
|
|
59
|
217
|
|
|
|
|
296
|
$name = $method.'('.join(', ', map { |
60
|
930
|
|
|
|
|
1098
|
my ($param, $value) = ($_, "$arg->{$_}"); |
61
|
217
|
100
|
|
|
|
371
|
$value = substr($value, 0, 32).'...' if length($value) > 32; |
62
|
217
|
|
|
|
|
554
|
qq($param => "$value"); |
63
|
|
|
|
|
|
|
} grep { |
64
|
155
|
|
|
|
|
1990
|
defined $arg->{$_} |
65
|
|
|
|
|
|
|
} qw(base scope filter dn newrdn newsuperior)).')'; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
155
|
|
|
|
|
204
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
69
|
155
|
|
|
|
|
346
|
Test::Net::LDAP::Util::ldap_result_is($mesg, $expected, $name); |
70
|
|
|
|
|
|
|
|
71
|
155
|
|
|
|
|
977
|
return $mesg; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |