|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
  
 
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # WARNING WARNING WARNING  | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # DO NOT CHANGE ANYTHING IN THIS MODULE. OTHERWISE, A LOT OF API   | 
| 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # AND OTHER TESTS MAY BREAK.  | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # This module is here to test certain behaviors. If you need  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # to test something else, add another test module.  | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # It's that simple.  | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # This does not need to be indexed by PAUSE  | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package  | 
| 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     RPC::ExtDirect::Test::Pkg::Foo;  | 
| 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
16
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
3006
 | 
 use strict;  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
939
 | 
    | 
| 
17
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
737
 | 
 use warnings;  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
199
 | 
    | 
| 
18
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
36
 | 
 no  warnings 'uninitialized';  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
223
 | 
    | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
20
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
1325
 | 
 use RPC::ExtDirect;  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
36
 | 
    | 
| 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
22
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Return scalar result  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_foo : ExtDirect(1, before => \&foo_before) {  | 
| 
24
 | 
7
 | 
 
 | 
 
 | 
  
7
  
 | 
  
0
  
 | 
30
 | 
     return "foo! '${_[1]}'"  | 
| 
25
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
36
 | 
 }  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
32
 | 
    | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Return arrayref result  | 
| 
28
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_bar  | 
| 
29
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     : ExtDirect(2, instead => \&foo_instead)  | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 {  | 
| 
31
 | 
3
 | 
 
 | 
 
 | 
  
3
  
 | 
  
0
  
 | 
21
 | 
     return [ 'foo! bar!', @_[1, 2], ];  | 
| 
32
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
1627
 | 
 }  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
41
 | 
    | 
| 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
34
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Return hashref result  | 
| 
35
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_baz : ExtDirect( params  => [foo, bar, baz], before  => \&foo_before, after   => \&foo_after) {  | 
| 
36
 | 
5
 | 
 
 | 
 
 | 
  
5
  
 | 
  
0
  
 | 
5
 | 
     my $class = shift;  | 
| 
37
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
     my %param = @_;  | 
| 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
39
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $ret = { msg => 'foo! bar! baz!', foo => $param{foo},  | 
| 
40
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 bar => $param{bar},      baz => $param{baz},  | 
| 
41
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
18
 | 
               };  | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
43
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13
 | 
     delete @param{ qw(foo bar baz) };  | 
| 
44
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
     @$ret{ keys %param } = values %param;  | 
| 
45
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
46
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
15
 | 
     return $ret;  | 
| 
47
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
1389
 | 
 }  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25
 | 
    | 
| 
48
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
49
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Testing zero parameters  | 
| 
50
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_zero : ExtDirect(0) {  | 
| 
51
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my ($class) = @_;  | 
| 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
53
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $ret = [ @_ ];  | 
| 
54
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
55
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $ret;  | 
| 
56
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
1163
 | 
 }  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25
 | 
    | 
| 
57
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Testing blessed object return  | 
| 
59
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_blessed : ExtDirect {  | 
| 
60
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
9
 | 
     return bless {}, 'foo';  | 
| 
61
 | 
9
 | 
 
 | 
 
 | 
  
9
  
 | 
 
 | 
921
 | 
 }  | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
    | 
| 
 
 | 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
27
 | 
    | 
| 
62
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
63
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Testing hooks  | 
| 
64
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_before {  | 
| 
65
 | 
3
 | 
 
 | 
 
 | 
  
3
  
 | 
  
0
  
 | 
18
 | 
     return 1;  | 
| 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
67
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub foo_instead {  | 
| 
69
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
6
 | 
     my ($class, %params) = @_;  | 
| 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
71
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4
 | 
     return $params{orig}->();  | 
| 
72
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
73
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
74
 | 
 
 | 
 
 | 
 
 | 
  
2
  
 | 
  
0
  
 | 
 
 | 
 sub foo_after {  | 
| 
75
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
76
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
77
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;  |