Branch Coverage

FileHandle.xs
Criterion Covered Total %
branch 167 320 52.1


line true false branch
97 0 0 if (FILE_STATE(file) != NYTP_FILE_STDIO) {
98 0 0 return FILE_STATE(file) == NYTP_FILE_INFLATE
169 0 385 CROAK_IF_NOT_STDIO(file, "NYTP_start_deflate");
182 0 385 if (status != Z_OK) {
192 0 755 CROAK_IF_NOT_STDIO(file, "NYTP_start_inflate");
204 0 755 if (status != Z_OK) {
217 0 2048 if (!raw_file)
221 0 2048 if (setvbuf(raw_file, NULL, _IOFBF, 16384))
259 899 33 if (ifile->zs.avail_in == 0 && !ifile->stdio_at_eof) {
899 0 if (ifile->zs.avail_in == 0 && !ifile->stdio_at_eof) {
263 0 899 if (got == 0) {
264 0 0 if (!feof(ifile->file)) {
292 755 177 if (!(status == Z_OK || status == Z_STREAM_END)) {
0 755 if (!(status == Z_OK || status == Z_STREAM_END)) {
293 0 0 if (ifile->stdio_at_eof)
302 899 33 if (ifile->zs.avail_out == 0 || status == Z_STREAM_END) {
755 144 if (ifile->zs.avail_out == 0 || status == Z_STREAM_END) {
303 755 33 if (status == Z_STREAM_END) {
321 5628300 6711775 if (FILE_STATE(ifile) == NYTP_FILE_STDIO) {
325 0 6711775 else if (FILE_STATE(ifile) != NYTP_FILE_INFLATE) {
333 6711020 1543 if (remaining >= len) {
344 755 788 if (ifile->zlib_at_eof)
355 0 9969101 if (got != len) {
356 0 0 croak("Profile format error whilst reading %s at %ld%s: expected %ld got %ld, %s (see TROUBLESHOOTING in docs)",
375 755 38947 if (FILE_STATE(ifile) == NYTP_FILE_INFLATE) {
384 755 0 if (nl) {
391 0 755 if (extra > len - prev_len) {
398 0 755 if (got != want)
402 755 0 if (nl) {
408 0 0 if (ifile->zlib_at_eof) {
417 0 38947 CROAK_IF_NOT_STDIO(ifile, "NYTP_gets");
421 38947 0 while(fgets(buffer + prev_len, (int)(len - prev_len), ifile->file)) {
425 38947 0 if (end[-1] == '\n') {
482 0 1261 if (status == Z_BUF_ERROR && flush != Z_NO_FLUSH
0 0 if (status == Z_BUF_ERROR && flush != Z_NO_FLUSH
483 0 0 && !ofile->zs.avail_in && ofile->zs.avail_out)
0 0 && !ofile->zs.avail_in && ofile->zs.avail_out)
493 363 898 if (status == Z_OK || status == Z_STREAM_END) {
363 0 if (status == Z_OK || status == Z_STREAM_END) {
494 1150 111 if (ofile->zs.avail_out == 0 || flush != Z_NO_FLUSH) {
1119 31 if (ofile->zs.avail_out == 0 || flush != Z_NO_FLUSH) {
496 1211 19 = ofile->zs.avail_in == 0 && ofile->zs.avail_out > 0;
1119 92 = ofile->zs.avail_in == 0 && ofile->zs.avail_out > 0;
501 1230 1230 while (avail > 0) {
504 1230 0 if (count > 0) {
515 1119 111 if (terminate) {
517 756 363 if (flush == Z_SYNC_FLUSH) {
541 2118621 2788637 if (FILE_STATE(ofile) == NYTP_FILE_STDIO) {
544 0 2118621 if (len == 0)
548 0 2118621 if (fwrite(buffer, 1, len, ofile->file) < 1) {
557 0 2788637 else if (FILE_STATE(ofile) != NYTP_FILE_DEFLATE) {
565 2788637 31 if (remaining >= len) {
590 0 705 CROAK_IF_NOT_STDIO(ofile, "NYTP_printf");
606 756 640 if (FILE_STATE(file) == NYTP_FILE_DEFLATE) {
620 755 588 if (FILE_STATE(ifile) == NYTP_FILE_INFLATE) {
633 0 0 if (FILE_STATE(file) == NYTP_FILE_DEFLATE || FILE_STATE(file) == NYTP_FILE_INFLATE) {
0 0 if (FILE_STATE(file) == NYTP_FILE_DEFLATE || FILE_STATE(file) == NYTP_FILE_INFLATE) {
651 2018 30 if (!discard && FILE_STATE(file) == NYTP_FILE_DEFLATE) {
363 1655 if (!discard && FILE_STATE(file) == NYTP_FILE_DEFLATE) {
660 385 1663 if (FILE_STATE(file) == NYTP_FILE_DEFLATE) {
662 22 363 if (status != Z_OK) {
663 22 0 if (discard && status == Z_DATA_ERROR) {
22 0 if (discard && status == Z_DATA_ERROR) {
674 755 908 else if (FILE_STATE(file) == NYTP_FILE_INFLATE) {
676 0 755 if (err != Z_OK) {
684 0 2048 result = ferror(raw_file) ? errno : 0;
686 30 2018 if (discard) {
692 2048 0 if (result || discard) {
30 2018 if (result || discard) {
697 0 2018 return fclose(raw_file) == 0 ? 0 : errno;
716 1078059 3238123 if (tag != NYTP_TAG_NO_TAG)
720 4006660 309522 if (i < 0x80) { /* < 8 bits */
723 309274 248 else if (i < 0x4000) { /* < 16 bits */
727 184 64 else if (i < 0x200000) { /* < 24 bits */
732 64 0 else if (i < 0x10000000) { /* < 32 bits */
770 9055874 313158 if (d < 0x80) { /* < 8 bits */
778 312748 410 if (d < 0xC0) { /* < 16 bits */
782 282 128 else if (d < 0xE0) { /* < 24 bits */
786 128 0 else if (d < 0xFF) { /* < 32 bits */
795 313696 313158 while (length--) {
816 0 107752 if (len < 0) {
822 0 107752 if (retval <= 0)
825 106243 1509 if (len) {
827 0 106243 if (retval <= 0)
876 0 1090 if (retval != 1)
881 0 1090 if(strEQ(format, "%s")) {
882 0 0 const char * const s = va_arg(args, char*);
886 0 1090 CROAK_IF_NOT_STDIO(ofile, "NYTP_printf");
895 0 1090 if (retval2 != 1)
910 0 19005 if (retval != 1)
914 0 19005 if (retval != key_len)
918 0 19005 if (retval != 1)
922 0 19005 if (retval != value_len)
926 0 19005 if (retval != 1)
951 0 2820 const size_t len = my_snprintf(buffer, sizeof(buffer), "%lu", value);
962 0 705 const size_t len = my_snprintf(buffer, sizeof(buffer), "%ld", value);
972 0 675 const size_t len = my_snprintf(buffer, sizeof(buffer), "%" NVgf, value);
992 0 12690 const size_t len = my_snprintf(buffer, sizeof(buffer), "%" IVdf, value);
1010 0 385 if (retval < 1)
1014 0 385 if (retval < 1)
1032 0 705 if (retval < 1)
1036 0 705 if (retval < 1)
1040 0 705 if (retval < 1)
1053 0 675 if (retval < 1)
1057 0 675 if (retval < 1)
1070 0 0 if (retval < 1)
1074 0 0 if (retval < 1)
1090 0 1667 if (retval < 1)
1094 0 1667 if (retval < 1)
1098 0 1667 if (retval < 1)
1102 0 1667 if (retval < 1)
1106 0 1667 if (retval < 1)
1110 0 1667 if (retval < 1)
1114 0 1667 if (retval < 1)
1127 0 862053 if (overflow) {
1135 0 862053 if (retval < 1)
1139 0 862053 if (retval < 1)
1143 0 862053 if (retval < 1)
1158 0 721700 if (retval < 1)
1162 0 721700 if (retval < 1)
1166 0 721700 if (retval < 1)
1187 0 4669 if (retval < 1)
1191 0 4669 if (retval < 1)
1205 0 60769 if (retval < 1)
1209 0 60769 if (retval < 1)
1213 0 60769 if (retval < 1)
1216 0 60769 if (!called_subname_pv)
1219 0 60769 if (retval < 1)
1235 0 6045 if (retval < 1)
1239 0 6045 if (retval < 1)
1243 0 6045 if (retval < 1)
1247 0 6045 if (retval < 1)
1264 0 5547 if (retval < 1)
1268 0 5547 if (retval < 1)
1272 0 5547 if (retval < 1)
1276 0 5547 if (retval < 1)
1280 0 5547 if (retval < 1)
1284 0 5547 if (retval < 1)
1288 0 5547 if (retval < 1)
1292 0 5547 if (retval < 1)
1296 0 5547 if (retval < 1)
1310 0 28177 if (retval < 1)
1314 0 28177 if (retval < 1)
1318 0 28177 if (retval < 1)
1344 0 0 if(!fh)
1375 0 0 p = SvPVbyte(string, len);
1410 0 0 const char *const key_p = SvPVbyte(key, key_len);
1412 0 0 const char *const value_p = SvPVbyte(value, value_len);
1425 0 0 const char *const key_p = SvPVbyte(key, key_len);
1427 0 0 const char *const value_p = SvPVbyte(value, value_len);
1458 0 0 const char *const p = SvPV(name, len);
1460 0 0 RETVAL = NYTP_write_new_fid(handle, id, eval_fid, eval_line_num,
1507 0 0 const char *const p = SvPV(name, len);
1509 0 0 RETVAL = NYTP_write_sub_info(handle, fid,
1529 0 0 const char *const caller_p = SvPV(caller, caller_len);
1531 0 0 const char *const called_p = SvPV(called_sub, called_len);
1533 0 0 RETVAL = NYTP_write_sub_callers(handle, fid, line, caller_p,
0 0 RETVAL = NYTP_write_sub_callers(handle, fid, line, caller_p,
1549 0 0 const char *const p = SvPV(text, len);
1551 0 0 RETVAL = NYTP_write_src_line(handle, fid, line,