Branch Coverage

blib/lib/Net/UCP.pm
Criterion Covered Total %
branch 58 610 9.5


line true false branch
65 0 0 unless defined $$self{'SOCK'}
66 0 0 unless (defined $$self{'SOCK'})
67 0 0 wantarray ? :
0 0 defined wantarray ? :
70 0 0 unless (defined $args{'SMSC_ID'} and length $args{'SMSC_ID'})
71 0 0 if $$self{'WARN'}
72 0 0 wantarray ? :
0 0 defined wantarray ? :
75 0 0 unless (defined $args{'SMSC_PW'} and length $args{'SMSC_PW'})
76 0 0 if $$self{'WARN'}
77 0 0 wantarray ? :
0 0 defined wantarray ? :
91 0 0 if (defined $message_string) { }
95 0 0 wantarray ? :
0 0 defined wantarray ? :
103 0 0 defined $$self{'SRC_HOST'} ? :
0 0 defined $$self{'SRC_PORT'} ? :
111 0 0 unless (defined $$self{'SOCK'})
112 0 0 if $$self{'WARN'}
123 0 0 unless defined $$self{'SOCK'}
146 0 0 if (defined $args{'TIMEOUT'}) { }
154 0 0 unless (defined $args{'RECIPIENT'} and length $args{'RECIPIENT'})
155 0 0 if $$self{'WARN'}
156 0 0 wantarray ? :
0 0 defined wantarray ? :
160 0 0 unless ($args{'RECIPIENT'} =~ /^\d+$/)
161 0 0 if $$self{'WARN'}
162 0 0 wantarray ? :
0 0 defined wantarray ? :
166 0 0 unless defined $args{'MESSAGE_TEXT'}
171 0 0 if defined $args{'SENDER_TEXT'} and length $args{'SENDER_TEXT'}
175 0 0 defined $args{'FLASH'} && $args{'FLASH'} == 1 ? :
176 0 0 $mclsTmp ? :
178 0 0 defined $args{'MESSAGE_BINARY'} ? :
0 0 defined $args{'MESSAGE_BINARY'} ? :
0 0 defined $args{'MESSAGE_BINARY'} ? :
0 0 defined $args{'MESSAGE_BINARY'} && defined $args{'MESSAGE_BINARY'} ? :
198 0 0 if (defined $args{'MESSAGE_BINARY'}) { }
237 0 0 unless $ret and defined $ret
248 0 0 if $min == $max
250 0 0 if $min > $max
261 0 0 if ($from =~ /^([0-9]+)$/) { }
0 0 elsif ($from =~ /^\+([0-9]+)$/) { }
263 0 0 if (length $from > 22)
268 0 0 if (length $from > 22)
272 0 0 if (length $from > 11)
294 0 0 if $class eq ''
303 0 0 if (not $class) { }
305 0 0 if $type eq 'T'
307 0 0 if ($udh =~ /\d+/ and $type eq 'T')
313 0 0 if ($udh =~ /\d+/ and $type eq 'T') { }
330 0 0 if $type eq 'B'
343 1 0 if @_ == 0
356 0 0 if ($args{'FAKE'} == 0)
358 0 0 $args{'WARN'} ? :
0 0 defined $args{'WARN'} ? :
361 0 0 unless (defined $args{'SMSC_HOST'} and length $args{'SMSC_HOST'})
362 0 0 if $$self{'WARN'}
367 0 0 unless (defined $args{'SMSC_PORT'} and length $args{'SMSC_PORT'})
368 0 0 if $$self{'WARN'}
373 0 0 unless ($args{'SMSC_PORT'} =~ /^\d+$/)
374 0 0 if $$self{'WARN'}
382 0 0 defined $args{'SENDER_TEXT'} && length $args{'SENDER_TEXT'} ? :
387 0 0 defined $args{'SHORT_CODE'} && length $args{'SHORT_CODE'} ? :
398 0 0 $@ ? :
418 0 0 if (exists $arg{'timeout'} and $arg{'timeout'} > 0)
419 0 0 exists $arg{'action'} && ref $arg{'action'} eq 'CODE' ? :
429 0 0 if ($retval)
436 0 0 if (exists $arg{'clear'})
437 0 0 if $arg{'clear'}
470 0 1 if ($op eq '01') { }
0 1 elsif ($op eq '02') { }
0 1 elsif ($op eq '03') { }
0 1 elsif ($op eq '30') { }
0 1 elsif ($op eq '31') { }
1 0 elsif ($op eq '51') { }
0 0 elsif ($op eq '52') { }
0 0 elsif ($op eq '53') { }
0 0 elsif ($op eq '54') { }
0 0 elsif ($op eq '55') { }
0 0 elsif ($op eq '56') { }
0 0 elsif ($op eq '57') { }
0 0 elsif ($op eq '58') { }
0 0 elsif ($op eq '60') { }
0 0 elsif ($op eq '61') { }
494 1 0 if (my($optype) = $resp =~ m[^\d{2}/\d{5}/.*?/(01|02|03|30|51|52|53|54|55|56|57|58|60|61)/.*])
518 0 1 if ($mess{'type'} eq 'O') { }
523 0 0 $mess{'mt'} == 2 ? :
524 0 0 $mess{'mt'} == 3 ? :
527 1 0 if ($ucp[4] eq 'A') { }
548 1 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
550 0 1 exists $arg{'nmsg'} && !exists($arg{'amsg'}) ? :
554 1 0 exists $arg{'adc'} ? :
1 0 exists $arg{'oadc'} ? :
1 0 exists $arg{'ac'} ? :
1 0 exists $arg{'mt'} ? :
584 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
586 0 0 exists $arg{'sm'} ? :
610 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
655 0 0 if ($mess{'type'} eq 'O') { }
661 0 0 $mess{'mt'} == 2 ? :
662 0 0 $mess{'mt'} == 3 ? :
665 0 0 if ($ucp[4] eq 'A') { }
687 1 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
689 0 1 exists $arg{'nmsg'} && !exists($arg{'amsg'}) ? :
693 1 0 exists $arg{'npl'} ? :
1 0 exists $arg{'rads'} ? :
1 0 exists $arg{'oadc'} ? :
1 0 exists $arg{'ac'} ? :
1 0 exists $arg{'mt'} ? :
725 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
727 0 0 exists $arg{'sm'} ? :
751 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
797 0 0 if ($mess{'type'} eq 'O') { }
813 0 0 $mess{'mt'} == 2 ? :
814 0 0 $mess{'mt'} == 3 ? :
817 0 0 if ($ucp[4] eq 'A') { }
839 0 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
841 0 0 exists $arg{'nmsg'} && !exists($arg{'amsg'}) ? :
845 0 0 exists $arg{'rad'} ? :
0 0 exists $arg{'oadc'} ? :
0 0 exists $arg{'ac'} ? :
0 0 exists $arg{'npl'} ? :
0 0 exists $arg{'gas'} ? :
0 0 exists $arg{'rp'} ? :
0 0 exists $arg{'pr'} ? :
0 0 exists $arg{'lpr'} ? :
0 0 exists $arg{'ur'} ? :
0 0 exists $arg{'lur'} ? :
0 0 exists $arg{'rc'} ? :
0 0 exists $arg{'lrc'} ? :
0 0 exists $arg{'dd'} ? :
0 0 exists $arg{'ddt'} ? :
0 0 exists $arg{'mt'} ? :
897 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
899 0 0 exists $arg{'sm'} ? :
923 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
969 0 0 if ($mess{'type'} eq 'O') { }
982 0 0 if ($ucp[4] eq 'A') { }
1005 0 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
1009 0 0 exists $arg{'adc'} ? :
0 0 exists $arg{'oadc'} ? :
0 0 exists $arg{'ac'} ? :
0 0 exists $arg{'nrq'} ? :
0 0 exists $arg{'nad'} ? :
0 0 exists $arg{'npid'} ? :
0 0 exists $arg{'dd'} ? :
0 0 exists $arg{'ddt'} ? :
0 0 exists $arg{'vp'} ? :
1049 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
1051 0 0 exists $arg{'mvp'} ? :
0 0 exists $arg{'sm'} ? :
1077 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
1123 0 0 if ($mess{'type'} eq 'O') { }
1128 0 0 if ($ucp[4] eq 'A') { }
1150 0 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
1152 0 0 exists $arg{'adc'} ? :
0 0 exists $arg{'pid'} ? :
1176 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
1178 0 0 exists $arg{'sm'} ? :
1202 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
1248 0 0 if ($mess{'type'} eq 'O') { }
1251 0 0 $mess{'otoa'} eq '5039' ? :
1270 0 0 if $mess{'mt'} and $mess{'mt'} == 2
1271 0 0 if $mess{'mt'} and $mess{'mt'} == 3
1272 0 0 if $mess{'mt'} and $mess{'mt'} == 4
1286 0 0 if ($ucp[4] eq 'A') { }
1310 1 0 if (exists $$arg{'operation'} and $$arg{'operation'} == 1) { }
0 0 elsif (exists $$arg{'result'} and $$arg{'result'} == 1) { }
1315 1 0 if (exists $$arg{'amsg'}) { }
1318 0 0 exists $$arg{'nmsg'} && !exists($$arg{'tmsg'}) ? :
1321 1 0 $$arg{'otoa'} eq '5039' ? :
1 0 if exists $$arg{'otoa'}
1326 1 0 exists $$arg{'adc'} ? :
0 1 exists $$arg{'ac'} ? :
0 1 exists $$arg{'nrq'} ? :
0 1 exists $$arg{'nadc'} ? :
0 1 exists $$arg{'nt'} ? :
0 1 exists $$arg{'npid'} ? :
0 1 exists $$arg{'lrq'} ? :
0 1 exists $$arg{'lrad'} ? :
0 1 exists $$arg{'lpid'} ? :
0 1 exists $$arg{'dd'} ? :
0 1 exists $$arg{'ddt'} ? :
0 1 exists $$arg{'vp'} ? :
0 1 exists $$arg{'rpid'} ? :
0 1 exists $$arg{'scts'} ? :
0 1 exists $$arg{'dst'} ? :
0 1 exists $$arg{'rsn'} ? :
0 1 exists $$arg{'dscts'} ? :
1 0 exists $$arg{'mt'} ? :
0 1 exists $$arg{'nb'} ? :
0 1 exists $$arg{'mms'} ? :
0 1 exists $$arg{'pr'} ? :
0 1 exists $$arg{'dcs'} ? :
1 0 exists $$arg{'mcls'} ? :
0 1 exists $$arg{'rpi'} ? :
0 1 exists $$arg{'cpg'} ? :
0 1 exists $$arg{'rply'} ? :
1 0 exists $$arg{'otoa'} ? :
0 1 exists $$arg{'hplmn'} ? :
0 1 exists $$arg{'xser'} ? :
0 1 exists $$arg{'res4'} ? :
0 1 exists $$arg{'res5'} ? :
1413 0 0 if (exists $$arg{'ack'} and $$arg{'ack'} ne '') { }
0 0 elsif (exists $$arg{'nack'} and $$arg{'nack'} ne '') { }
1415 0 0 exists $$arg{'mvp'} ? :
0 0 exists $$arg{'sm'} ? :
1441 0 0 exists $$arg{'ec'} ? :
0 0 exists $$arg{'sm'} ? :
1577 0 0 if ($mess{'type'} eq 'O') { }
1592 0 0 if ($ucp[4] eq 'A') { }
1619 0 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
1621 0 0 exists $arg{'oadc'} ? :
0 0 exists $arg{'oton'} ? :
0 0 exists $arg{'onpi'} ? :
0 0 exists $arg{'styp'} ? :
0 0 exists $arg{'pwd'} ? :
0 0 exists $arg{'npwd'} ? :
0 0 exists $arg{'vers'} ? :
0 0 exists $arg{'ladc'} ? :
0 0 exists $arg{'lton'} ? :
0 0 exists $arg{'lnpi'} ? :
0 0 exists $arg{'opid'} ? :
0 0 exists $arg{'res1'} ? :
1665 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
1667 0 0 exists $arg{'sm'} ? :
1691 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
1727 0 0 if (exists $arg{'operation'} and $arg{'operation'} == 1) { }
0 0 elsif (exists $arg{'result'} and $arg{'result'} == 1) { }
1729 0 0 exists $arg{'oadc'} ? :
0 0 exists $arg{'oton'} ? :
0 0 exists $arg{'onpi'} ? :
0 0 exists $arg{'styp'} ? :
0 0 exists $arg{'pwd'} ? :
0 0 exists $arg{'npwd'} ? :
0 0 exists $arg{'vers'} ? :
0 0 exists $arg{'ladc'} ? :
0 0 exists $arg{'lton'} ? :
0 0 exists $arg{'lnpi'} ? :
0 0 exists $arg{'opid'} ? :
0 0 exists $arg{'res1'} ? :
0 0 exists $arg{'res2'} ? :
1775 0 0 if (exists $arg{'ack'} and $arg{'ack'} ne '') { }
0 0 elsif (exists $arg{'nack'} and $arg{'nack'} ne '') { }
1777 0 0 exists $arg{'sm'} ? :
1801 0 0 exists $arg{'ec'} ? :
0 0 exists $arg{'sm'} ? :
1842 0 0 exists $opt{'host'} && $opt{'host'} ne '' ? :
0 0 exists $opt{'port'} && $opt{'port'} ne '' ? :
0 0 exists $opt{'listen'} ? :
1848 0 0 unless $main_socket
1851 0 0 exists $opt{'output'} && $opt{'output'} == 1 ? :
1854 0 0 if (exists $opt{'reading_mode'})
1855 0 0 if ($opt{'reading_mode'} != 0 and $opt{'reading_mode'} != 1) { }
1862 0 0 exists $opt{'max_len'} && $opt{'max_len'} >= 1 ? :
1872 0 0 if ($sock == $main_socket) { }
1877 0 0 if $debug
1880 0 0 unless $reading_mode
1881 0 0 if $reading_mode == 1
1883 0 0 if ($message) { }
1885 0 0 if ($debug)
1893 0 0 if (exists $opt{'action'} and ref $opt{'action'} eq 'CODE') { }
1895 0 0 if defined $resp_be and $resp_be ne ''
1897 0 0 if (exists $opt{'sending'} and ref $opt{'sending'} eq 'CODE')
1899 0 0 if defined $next_ucp_message and $next_ucp_message ne ''
1904 0 0 if (ref $response eq 'HASH') { }
1906 0 0 if $debug
1914 0 0 if $debug
1931 0 0 unless (defined $timeout)
1933 0 0 unless (defined $$self{'SOCK'})
1946 0 0 if ($need_resp == 1) { }
1949 0 0 if ($$self{'CAN_ALARM'}) { }
1958 0 0 if $@ and $@ ne "alarm\n"
1964 0 0 unless (defined $rd)
1966 0 0 if $$self{'WARN'}
1967 0 0 wantarray ? :
0 0 defined wantarray ? :
1969 0 0 unless ($rd)
1971 0 0 if $$self{'WARN'}
1972 0 0 wantarray ? :
0 0 defined wantarray ? :
1978 0 0 if ($acknack eq 'A') { }
1988 0 0 wantarray ? :
0 0 defined wantarray ? :
1991 0 0 wantarray ? :
0 0 defined wantarray ? :