FFI.pm

filter: Statementstmt 66.6% 14 / 21 Branchbran 0.0% 0 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 60.6% 20 / 33 CC 3 SCAR 13.3
CC
3
Cov
58%
new
6.5
BEGIN
1.0
BEGIN
1.0
CRAP 3.8
« FFI/ZMQ3/Context.pm ↑ Summary FFI/ZMQ3/Socket.pm »
1 package ZMQ::FFI;
2 # ABSTRACT: zeromq bindings using libffi and FFI::Raw
3 10 $ZMQ::FFI::VERSION = '0.16';
4 10 ▶use ZMQ::FFI::Util qw(zmq_soname zmq_version);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 10 ▶use ZMQ::FFI::ErrorHelper;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 10 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub new {
9 10 ▶ my $self = shift;
Subroutine new: called CC=3 SCAR=18.8
Pod documented
10 10 my %args = @_;
11  
12 10 ▶ $args{soname} //= zmq_soname( die => 1 );
Condition33%1/3
$args{"soname"} //= zmq_soname("die", 1)
l!l&&r!l&&!r
0010
MC/DC0%0/2
$args{"soname"} //= zmq_soname("die", 1)
$args{"soname"} zmq_soname("die", 1)
Truth table33%1/3
A //= B
A= $args{"soname"}B= zmq_soname("die", 1)
ABresult
1X1
011
000
13  
14 # explicitly passing in a loaded error helper instance
15 # (i.e. zmq error bindings) guards against the OS X loader clobbering errno,
16 # which can happen if the bindings are loaded lazily
17 $args{error_helper} =
18 0 ZMQ::FFI::ErrorHelper->new( soname => $args{soname} );
19  
20 0 my ($major) = zmq_version($args{soname});
21  
22 0 ▶ if ($major == 2) {
Branch: 1 branch
BranchTrueFalseTotal
if ($major == 2) { } 0 0 0
23 0 require ZMQ::FFI::ZMQ2::Context;
24 0 return ZMQ::FFI::ZMQ2::Context->new(%args);
25 }
26 else {
27 0 require ZMQ::FFI::ZMQ3::Context;
28 0 return ZMQ::FFI::ZMQ3::Context->new(%args);
29 }
30 };
31  
32 10 1;
33  
34 __END__
« FFI/ZMQ3/Context.pm ↑ Summary FFI/ZMQ3/Socket.pm »