blib/lib/POSIX/1003/Events.pm

filter: Statementstmt 58.3% 21 / 36 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 35.7% 5 / 14 Podpod 100% 7 / 7 totaltotal 50.0% 33 / 66 CC 5 SCAR 14.5
CC
5
Cov
48%
_create_constant
12.0
select
6.0
poll
6.0
CRAP 4.3
« blib/lib/POSIX/SigAction.pm ↑ Summary blib/lib/POSIX/1003/FS.pm »
1 # Copyrights 2011-2013 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.01.
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 package POSIX::1003::Events;
9 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 $VERSION = '0.98';
11  
12 1 ▶use base 'POSIX::1003::Module';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 my @constants;
15 1 my @functions = qw/
16 FD_CLR FD_ISSET FD_SET FD_ZERO select
17 poll poll_names
18 /;
19  
20 1 my @poll = qw(poll poll_names);
21  
22 1 our %EXPORT_TAGS =
23 ( constants => \@constants
24 , functions => \@functions
25 );
26  
27 1 my $poll;
28  
29 BEGIN {
30 1 ▶ $poll = poll_table;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 push @constants, keys %$poll;
32 }
33  
34  
35 sub select($$$;$)
36 0 ▶{ push @_, undef if @_==3;
Subroutine select: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 3 0 0 0
37 0 goto &select;
38 }
39  
40  
41 0 ▶sub FD_CLR($$) {vec($_[1],$_[0],1) = 0}
Subroutine FD_CLR: not called CC=1 SCAR=6.9
Pod documented
42 0 ▶sub FD_ISSET($$) {vec($_[1],$_[0],1) ==1}
Subroutine FD_ISSET: not called CC=1 SCAR=6.9
Pod documented
43 0 ▶sub FD_SET($$) {vec($_[1],$_[0],1) = 1}
Subroutine FD_SET: not called CC=1 SCAR=6.9
Pod documented
44 0 ▶sub FD_ZERO($) {$_[0] = 0}
Subroutine FD_ZERO: not called CC=1 SCAR=6.9
Pod documented
45  
46  
47 sub poll($;$)
48 0 ▶{ my ($data, $timeout) = @_;
Subroutine poll: not called CC=2 SCAR=17.9
Pod documented
49 0 ▶ defined $timeout or $timeout = -1;
Branch: 1 branch
BranchTrueFalseTotal
defined $timeout or $timeout = -1 0 0 0
50 0 _poll($data, $timeout);
51 }
52  
53 #----------------------
54  
55 0 ▶sub poll_names() { keys %$poll }
Subroutine poll_names: not called CC=1 SCAR=6.9
Pod documented
56  
57 sub _create_constant($)
58 0 ▶{ my ($class, $name) = @_;
Subroutine _create_constant: not called CC=3 SCAR=24.8
59 0 ▶ $name =~ m/^POLL/
Branch: 1 branch
BranchTrueFalseTotal
$name =~ /^POLL/ or die "constants expected to start with POLL, not $name\n" 0 0 0
60 or die "constants expected to start with POLL, not $name\n";
61 0 ▶ my $val = $poll->{$name} // return sub() {undef};
Condition0%0/2
$poll->{$name} // (return sub () { undef } )
l!l
00
MC/DC0%0/1
$poll->{$name} // (return sub () { undef } )
$poll->{$name}
Truth table0%0/2
A
A= $poll->{$name}
Aresult
11
00
62 0 ▶ sub() {$val};
Subroutine __ANON__: not called CC=1 SCAR=6.9
63  
64 }
65 #----------------------
66  
67 1 1;
« blib/lib/POSIX/SigAction.pm ↑ Summary blib/lib/POSIX/1003/FS.pm »