Branch Coverage

blib/lib/POE/Kernel.pm
Criterion Covered Total %
branch 239 286 83.5


line true false branch
33 177 0 unless ($queue_class)
44 1 506 if $args and ref $args ne 'HASH'
60 1 505 if @unknown
64 177 328 unless (UNIVERSAL::can('POE::Kernel', 'poe_kernel_loop'))
65 6 171 if (defined $loop)
67 0 6 if (defined $2) { }
77 175 0 if UNIVERSAL::can('POE::Kernel', 'poe_kernel_loop')
89 0 177 if ($^O eq 'MSWin32') { }
105 169 8 unless (defined &CATCH_EXCEPTIONS)
106 1 168 exists $ENV{'POE_CATCH_EXCEPTIONS'} ? :
112 168 1 if ($catch_exceptions) { }
120 177 0 unless (defined &CHILD_POLLING_INTERVAL)
125 161 16 unless (defined &USE_SIGCHLD)
129 161 0 if ($] >= 5.008001 and not RUNNING_IN_HELL()) { }
136 174 3 unless (defined &USE_SIGNAL_PIPE)
138 0 174 if (exists $ENV{'POE_USE_SIGNAL_PIPE'})
142 0 174 if (RUNNING_IN_HELL())
143 0 0 if ($use_signal_pipe)
154 174 0 if ($use_signal_pipe or not defined $use_signal_pipe) { }
324 0 1416 if defined *{"TRACE_$name";}{'CODE'}
343 3 882 if defined *{"ASSERT_$name";}{'CODE'}
353 3894 11 unless $var =~ /^POE_([A-Z_]+)$/
357 10 1 unless $const =~ /^(?:TRACE|ASSERT)_/ or do { no strict 'refs'; defined &$const }
363 1 0 if $value =~ /^\s*-?\d+(?:\.\d+)?\s*$/
374 0 177 if defined &TRACE_FILENAME
375 0 177 if (defined $trace_filename)
376 0 0 unless open $trace_file_handle, ">$trace_filename"
385 66 111 unless defined &TRACE_DEFAULT
394 46 131 unless defined &ASSERT_DEFAULT
465 28329 23179 unless $message =~ /\n$/
473 1 0 unless $message =~ /\n$/
486 49 338460 if -r "$dir/$mod"
501 2 175 if ($@ and not $@ =~ /not really dying/)
517 6 171 if (defined $used_first)
523 0 15391 if substr($file, -3) ne '.pm'
532 0 15391 if $module =~ /[^\w\.]/
537 15391 0 unless (_find_loop($module))
539 15342 49 unless _find_loop($module)
542 0 49 if (defined $used_first and $used_first ne $module)
559 122 49 unless (defined $used_first)
561 122 0 unless (_find_loop($used_first))
589 3642 205 if defined $session
593 83 122 if defined $session
597 116 6 if defined $session
601 0 6 if $whatever eq $self
640 0 1698 if $kr_queue->get_item_count > $idle_queue_size or $self->_data_handle_count or $self->_data_extref_count or $self->_data_sig_kernel_awaits_pids or not $self->_data_ses_count
711 15 432 if (defined $event_name) { }
732 3 283 unless (defined $session)
753 1 404 if ($kr_active_event eq '_signal')
785 253 233 if (defined $event_name) { }
0 108 elsif ($self->_data_sig_pids_is_ses_watching($kr_active_session->ID, $pid)) { }
806 175 108 unless (defined $POE::Kernel::poe_kernel)
930 113 462 if ($signal eq 'DIE')
942 208 259 if ($self->_data_sig_explicitly_watched($signal)) { }
951 11 374 unless exists $signal_watchers{$target_sid}
984 171 296 if ($signal eq 'DIE' and not $handled_session_count)
985 453 170 defined $POE::Kernel::kr_exception ? :
1028 369 7970 if $type & 32
1059 203 7983 unless defined $session
1067 3802 4021 if not defined $old_sig_die or $old_sig_die eq 'DEFAULT'
1072 4847 4087 if ($wantarray) { }
519 7069 elsif (defined $wantarray) { }
1095 591 6700 if (ref $@ or $@ ne '')
1108 88 5525 if ($type & 4104 or $kr_active_session eq $self) { }
1139 107 5377 if (!defined($old_sig_die) || $old_sig_die eq 'DEFAULT' and $SIG{'__DIE__'} ne \&_dummy_sigdie_handler)
1163 13 7212 if (defined $return and substr(ref $return, 0, 5) eq 'POE::')
1181 2277 4975 unless $type & 14
1184 167 2062 $wantarray ? :
1236 17 4191 unless ($self->_data_ses_count)
1239 1229 4226 if $POE::Kernel::kr_exception
1244 105 3550 if $POE::Kernel::kr_exception
1251 2997 841 unless defined $POE::Kernel::poe_kernel
1258 2713 1032 if ($kr_pid != $$)
1267 0 1014 if ($self->_data_ses_count == 0) { }
1287 11 178 if $POE::Kernel::kr_exception
1319 7 11 if ($self->_data_ses_exists($self->ID))
1348 0 18 if $kr_pid != $$
1361 0 4 if ($kr_pid == $$)
1386 0 0 unless ($kr_run_warning & 1)
1387 0 0 if ($kr_run_warning & 2)
1412 360 1212 if ($event eq '_sigchld_poll') { }
189 1023 elsif ($event eq '_signal') { }
1421 189 0 if ($$etc[0] eq 'IDLE')
1422 189 0 unless ($kr_queue->get_item_count > $idle_queue_size or $self->_data_handle_count)
1449 94 705 if ($kr_run_warning & 4)
1487 1 784 unless ($self->_data_ses_exists($new_sid))
1504 0 734 unless ($self->_data_ses_exists($new_sid))
1533 1 604 if ($self->_data_ses_get_parent($kr_active_session->ID) == $self)
1543 0 10 unless $kr_active_event_type & 4
1579 11 9 unless (defined $child_session)
1586 0 8 if ($kr_active_session == $self)
1592 0 8 unless ($self->_data_ses_is_child($kr_active_session->ID, $child_session->ID))
1667 2 331 unless (defined $session)
1727 4 4487 unless (defined $session)
1742 2 3475 if (wantarray)
1743 4 2037 $session == $kr_active_session ? :
1756 0 2038 if $POE::Kernel::kr_exception
1762 2 3473 if (defined wantarray)
1763 2 0 $session == $kr_active_session ? :
1776 0 2 if $POE::Kernel::kr_exception
1782 2536 73 if ($session == $kr_active_session) { }
1796 0 2598 if $POE::Kernel::kr_exception
1820 167 3563 unless (defined $event_name)
1829 0 3562 if (defined $time) { }
1838 878 2685 unless $kr_queue->get_item_count
1860 2 2551 unless (defined $event_name and defined $time)
1889 16 2395 unless (defined $event_name)
1894 1898 1752 if (defined $delay) { }
1929 2 304 unless (defined $event_name and defined $delay)
1958 3 542 unless (defined $event_name)
1964 234 296 unless (defined $time)
1995 3 470 unless (defined $alarm_id)
2003 1 469 unless defined $time
2010 8 219 unless defined wantarray
2011 215 4 if wantarray
2027 4 35 unless (defined $alarm_id)
2033 2 31 unless (defined $delta)
2065 3 48 unless (defined $event_name)
2078 2 16 unless (defined $seconds)
2108 2 11 unless (defined $alarm_id)
2114 3 8 unless (defined $seconds)
2142 3 2 unless $self->_data_ses_exists($kr_active_session->ID)
2153 0 2 unless defined wantarray
2154 2 0 if wantarray
2167 1158 1564 if ($event_name) { }
2293 5 2430 unless $self->_data_handle_is_good($handle, 1)
2314 6 2722 unless $self->_data_handle_is_good($handle, 1)
2335 11 2690 unless $self->_data_handle_is_good($handle, 0)
2356 283 2664 unless $self->_data_handle_is_good($handle, 0)
2379 7 185 if (defined $existing_session)
2380 4 718 if ($existing_session != $kr_active_session)
2402 44 263 unless (defined $existing_session)
2407 2 60 if ($existing_session != $kr_active_session)
2435 2 69 unless (defined $session)
2442 4 4 wantarray ? :
2463 0 179 unless defined $hostname
2472 4 175 if (defined $old_id)
2496 1 5 if defined $session
2514 5 32 if (defined $id)
2540 33 103 unless ($self->_data_ses_exists($session_id))
2561 3 203 unless ($self->_data_ses_exists($session_id))
2580 2038 201 unless defined $state_alias
2591 790 1347 if (ref $kr_active_session ne '' and ref $kr_active_session ne 'POE::Kernel')