Branch Coverage

blib/lib/FTN/JAM.pm
Criterion Covered Total %
branch 41 332 12.3


line true false branch
68 0 0 unless my($jampath) = @_
77 0 0 unless ($jhrres and $jdxres and $jdtres and $jlrres)
78 0 0 if ($jhrres)
81 0 0 if ($jdxres)
84 0 0 if ($jdtres)
87 0 0 if ($jlrres)
132 0 1 if ($#_ != 1)
144 0 1 if ($hasjdx or $hasjhr or $hasjdt or $hasjlr)
156 0 1 unless ($jhrres and $jdxres and $jdtres and $jlrres)
157 0 0 if ($jhrres)
160 0 0 if ($jdxres)
163 0 0 if ($jdtres)
166 0 0 if ($jlrres)
207 0 1 unless (LockMB(\%filehash, 0))
212 0 1 unless (WriteMBHeader(\%filehash, \%header))
230 0 1 unless my($handleref) = @_
232 0 1 unless close $$handleref{'jdx'}
233 0 1 unless close $$handleref{'jhr'}
234 0 1 unless close $$handleref{'jdt'}
235 0 1 unless close $$handleref{'jlr'}
248 0 1 unless my($jampath) = @_
255 1 0 if ($hasjdx)
256 0 1 unless (unlink $jampath . '.jdx')
262 1 0 if ($hasjhr)
263 0 1 unless (unlink $jampath . '.jhr')
269 1 0 if ($hasjdt)
270 0 1 unless (unlink $jampath . '.jdt')
276 1 0 if ($hasjlr)
277 0 1 unless (unlink $jampath . '.jlr')
293 0 1 if ($#_ != 1)
300 0 1 if ($$handleref{'locked'})
304 1 0 if (flock $$handleref{'jhr'}, 6)
312 0 0 if (flock $$handleref{'jhr'}, 6)
330 0 1 unless my($handleref) = @_
332 1 0 if ($$handleref{'locked'})
346 0 1 if ($#_ != 1)
356 0 1 unless (seek $$handleref{'jhr'}, 0, 0)
361 0 1 if (read($$handleref{'jhr'}, $buf, 1024) != 1024)
368 0 1 if ($data[0] ne 'JAM')
392 0 1 if ($#_ != 1)
399 0 1 unless (defined $$headerref{'DateCreated'})
402 1 0 unless (defined $$headerref{'ModCounter'})
403 1 0 unless (defined $$headerref{'ActiveMsgs'})
404 0 1 unless (defined $$headerref{'PasswordCRC'})
407 0 1 unless (defined $$headerref{'BaseMsgNum'})
409 0 1 unless ($$handleref{'locked'})
417 0 1 unless (seek $$handleref{'jhr'}, 0, 0)
429 0 1 unless ($printres)
444 0 1 if ($#_ != 1)
454 0 1 unless (seek $$handleref{'jdx'}, 0, 2)
461 0 1 if ($offset == -1)
478 0 0 if ($#_ != 4)
492 0 0 unless (ReadMBHeader($handleref, \%mbheader))
496 0 0 unless (seek $$handleref{'jdx'}, ($msgnum - $mbheader{'BaseMsgNum'}) * 8, 0)
502 0 0 if (read($$handleref{'jdx'}, $buf, 8) != 8)
509 0 0 if ($data[0] == 4294967295 and $data[1] == 4294967295)
514 0 0 unless (seek $$handleref{'jhr'}, $data[1], 0)
519 0 0 if (read($$handleref{'jhr'}, $buf, 76) != 76)
526 0 0 if ($data[0] ne 'JAM')
531 0 0 if ($data[1] != 1)
559 0 0 if ($subfieldsref)
560 0 0 if (read($$handleref{'jhr'}, $buf, $$headerref{'SubfieldLen'}) != $$headerref{'SubfieldLen'})
578 0 0 if ($textref)
579 0 0 unless (seek $$handleref{'jdt'}, $$headerref{'TxtOffset'}, 0)
584 0 0 if (read($$handleref{'jdt'}, $$textref, $$headerref{'TxtLen'}) != $$headerref{'TxtLen'})
603 0 0 if ($#_ != 2)
611 0 0 unless (defined $$headerref{'Signature'})
614 0 0 unless (defined $$headerref{'Revision'})
615 0 0 unless (defined $$headerref{'ReservedWord'})
618 0 0 unless (defined $$headerref{'SubfieldLen'})
621 0 0 unless (defined $$headerref{'TimesRead'})
622 0 0 unless (defined $$headerref{'MsgIdCRC'})
625 0 0 unless (defined $$headerref{'ReplyCRC'})
628 0 0 unless (defined $$headerref{'ReplyTo'})
629 0 0 unless (defined $$headerref{'Reply1st'})
630 0 0 unless (defined $$headerref{'ReplyNext'})
631 0 0 unless (defined $$headerref{'DateWritten'})
634 0 0 unless (defined $$headerref{'DateReceived'})
637 0 0 unless (defined $$headerref{'DateProcessed'})
640 0 0 unless (defined $$headerref{'MsgNum'})
641 0 0 unless (defined $$headerref{'Attributes'})
642 0 0 unless (defined $$headerref{'Attributes2'})
645 0 0 unless (defined $$headerref{'TxtOffset'})
646 0 0 unless (defined $$headerref{'TxtLen'})
647 0 0 unless (defined $$headerref{'PasswordCRC'})
650 0 0 unless (defined $$headerref{'Cost'})
652 0 0 unless ($$handleref{'locked'})
661 0 0 unless (ReadMBHeader($handleref, \%mbheader))
665 0 0 if ($$headerref{'Attributes'} & $FTN::JAM::Attr::DELETED)
668 0 0 unless (ReadMessage($handleref, $msgnum, \%oldheader, 0, 0))
672 0 0 unless ($oldheader{'Attributes'} & $FTN::JAM::Attr::DELETED)
673 0 0 if ($mbheader{'ActiveMsgs'})
679 0 0 unless (seek $$handleref{'jdx'}, ($msgnum - $mbheader{'BaseMsgNum'}) * 8, 0)
685 0 0 if (read($$handleref{'jdx'}, $buf, 8) != 8)
692 0 0 unless (seek $$handleref{'jhr'}, $data[1], 0)
711 0 0 unless ($printres)
716 0 0 unless (WriteMBHeader($handleref, \%mbheader))
730 0 0 if ($#_ != 3)
742 0 0 unless ($headerref)
743 0 0 unless (ReadMBHeader($handleref, \%mbheader))
747 0 0 unless (seek $$handleref{'jdx'}, 0, 2)
754 0 0 if ($jdxoffset == -1)
761 0 0 unless ($printres)
769 0 0 unless (defined $$headerref{'Signature'})
772 0 0 unless (defined $$headerref{'Revision'})
773 0 0 unless (defined $$headerref{'ReservedWord'})
776 0 0 unless (defined $$headerref{'SubfieldLen'})
779 0 0 unless (defined $$headerref{'TimesRead'})
780 0 0 unless (defined $$headerref{'MsgIdCRC'})
783 0 0 unless (defined $$headerref{'ReplyCRC'})
786 0 0 unless (defined $$headerref{'ReplyTo'})
787 0 0 unless (defined $$headerref{'Reply1st'})
788 0 0 unless (defined $$headerref{'ReplyNext'})
789 0 0 unless (defined $$headerref{'DateWritten'})
792 0 0 unless (defined $$headerref{'DateReceived'})
795 0 0 unless (defined $$headerref{'DateProcessed'})
798 0 0 unless (defined $$headerref{'MsgNum'})
799 0 0 unless (defined $$headerref{'Attributes'})
800 0 0 unless (defined $$headerref{'Attributes2'})
803 0 0 unless (defined $$headerref{'TxtOffset'})
804 0 0 unless (defined $$headerref{'TxtLen'})
805 0 0 unless (defined $$headerref{'PasswordCRC'})
808 0 0 unless (defined $$headerref{'Cost'})
810 0 0 unless ($$handleref{'locked'})
818 0 0 unless (ReadMBHeader($handleref, \%mbheader))
825 0 0 if ($textref and length $$textref)
826 0 0 unless (seek $$handleref{'jdt'}, 0, 2)
833 0 0 if ($jdtoffset == -1)
843 0 0 unless ($printres)
855 0 0 if ($$subfieldsref[$i] == $FTN::JAM::Subfields::RECVRNAME)
859 0 0 if ($$subfieldsref[$i] == $FTN::JAM::Subfields::MSGID)
863 0 0 if ($$subfieldsref[$i] == $FTN::JAM::Subfields::REPLYID)
870 0 0 unless (seek $$handleref{'jdx'}, 0, 2)
877 0 0 if ($jdxoffset == -1)
886 0 0 unless (seek $$handleref{'jhr'}, 0, 2)
893 0 0 if ($jhroffset == -1)
912 0 0 unless ($printres)
923 0 0 unless ($printres)
931 0 0 unless ($printres)
936 0 0 unless ($$headerref{'Attributes'} & $FTN::JAM::Attr::DELETED)
940 0 0 unless (WriteMBHeader($handleref, \%mbheader))
955 0 0 unless my($data) = @_
966 0 0 if ($crc & 1) { }
995 0 0 if ($#_ != 2)
1005 0 0 unless (ReadMBHeader($handleref, \%mbheader))
1009 0 0 unless (seek $$handleref{'jdx'}, ($start - $mbheader{'BaseMsgNum'}) * 8, 0)
1021 0 0 if (read($$handleref{'jdx'}, $buf, 8) != 8)
1022 0 0 if (eof $$handleref{'jdx'}) { }
1034 0 0 if ($data[0] == $usercrc)
1050 0 0 if ($#_ != 2)
1058 0 0 unless (seek $$handleref{'jlr'}, 0, 0)
1069 0 0 if ($data[1] == $usernum)
1081 0 0 if (eof $$handleref{'jlr'}) { }
1098 0 0 if ($#_ != 2)
1106 0 0 unless (defined $$lastreadref{'UserCRC'})
1107 0 0 unless (defined $$lastreadref{'UserID'})
1108 0 0 unless (defined $$lastreadref{'LastReadMsg'})
1111 0 0 unless (defined $$lastreadref{'HighReadMsg'})
1115 0 0 unless (seek $$handleref{'jlr'}, 0, 0)
1126 0 0 if ($data[1] == $usernum)
1127 0 0 unless (seek $$handleref{'jlr'}, -16, 1)
1136 0 0 unless ($printres)
1145 0 0 unless (eof $$handleref{'jlr'})
1153 0 0 unless ($printres)
1168 0 1 if ($#_ != 0)
1182 0 0 if ($#_ != 0)